/**
 * Paperback Lane - Primary Stylesheet
 * Evocative, warm, authentic independent bookstore aesthetic.
 * Fully Responsive with Fluid Typography, Touch Targets & Dynamic Spacing.
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&display=swap');

:root {
    --c-cream: #faf5eb;
    --c-cream-alt: #f3ebd9;
    --c-cream-card: #ffffff;
    --c-cream-parchment: #fdf8ef;
    --c-forest: #0f271b;
    --c-forest-dark: #08170f;
    --c-forest-light: #19402c;
    --c-forest-accent: #23553c;
    --c-burgundy: #4e1417;
    --c-burgundy-light: #732024;
    --c-gold: #cfa444;
    --c-gold-hover: #b58d31;
    --c-gold-soft: #fcf1d8;
    --c-gold-glow: rgba(207, 164, 68, 0.35);
    --c-wood: #2c160b;
    --c-wood-light: #4a2816;
    --c-charcoal: #221e1d;
    --c-muted: #6e645a;
    --c-border: #e4d8c5;
    --c-border-dark: #cbbeaa;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-heading: 'Cinzel', 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-quote: 'Cormorant Garamond', Georgia, serif;
    --shadow-book: 6px 10px 22px rgba(15, 39, 27, 0.28), 0 3px 6px rgba(0,0,0,0.14);
    --shadow-book-hover: 12px 20px 32px rgba(15, 39, 27, 0.38), -3px 4px 10px rgba(0,0,0,0.18);
    --shadow-warm: 0 10px 30px rgba(74, 40, 22, 0.12);
}

/* =========================================================
   BASE & RESPONSIVE FLUID TYPOGRAPHY
   ========================================================= */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--c-cream);
    color: var(--c-charcoal);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    word-wrap: break-word;
}

h1, .h1 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: clamp(1.6rem, 4vw + 0.3rem, 2.35rem);
    line-height: 1.25;
}

h2, .h2 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: clamp(1.35rem, 3vw + 0.2rem, 1.95rem);
    line-height: 1.3;
}

h3, .h3 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: clamp(1.2rem, 2.2vw + 0.2rem, 1.6rem);
    line-height: 1.35;
}

h4, .h4 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: clamp(1.05rem, 1.8vw + 0.2rem, 1.35rem);
}

h5, .h5 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: clamp(0.95rem, 1.5vw + 0.2rem, 1.15rem);
}

h6, .h6 {
    font-family: var(--font-serif);
    color: var(--c-forest);
    font-size: 0.95rem;
}

.display-5 {
    font-family: var(--font-serif);
    font-size: clamp(1.85rem, 4.5vw + 0.5rem, 2.75rem) !important;
    line-height: 1.2;
}

.display-6 {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3.5vw + 0.3rem, 2.2rem) !important;
    line-height: 1.25;
}

.font-heading {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

.font-quote {
    font-family: var(--font-quote);
}

.text-forest { color: var(--c-forest) !important; }
.text-gold { color: var(--c-gold) !important; }
.text-burgundy { color: var(--c-burgundy) !important; }
.bg-forest { background-color: var(--c-forest) !important; }
.bg-burgundy { background-color: var(--c-burgundy) !important; color: #ffffff !important; }
.bg-burgundy-light { background-color: var(--c-burgundy-light) !important; color: #ffffff !important; }
.bg-gold { background-color: var(--c-gold) !important; color: #173224 !important; }
.bg-gold-soft { background-color: var(--c-gold-soft) !important; color: #173224 !important; }
.border-gold { border-color: var(--c-gold) !important; }
.bg-cream-alt { background-color: var(--c-cream-alt) !important; }
.bg-wood { background-color: var(--c-wood) !important; }

/* Responsive Container Spacing */
.container {
    padding-left: clamp(1rem, 3vw, 1.75rem);
    padding-right: clamp(1rem, 3vw, 1.75rem);
}

/* =========================================================
   TOP NOTICE BAR & NAVBAR (Mobile & Desktop)
   ========================================================= */
.top-notice-bar {
    background-color: var(--c-forest-dark);
    color: #e4ded3;
    font-size: clamp(0.72rem, 1.5vw, 0.825rem);
    padding: clamp(0.35rem, 1vw, 0.5rem) 0;
    border-bottom: 1px solid rgba(200, 157, 58, 0.25);
}
.top-notice-bar a {
    color: var(--c-gold);
    text-decoration: underline;
}

.bookstore-navbar {
    background-color: var(--c-cream-card);
    border-bottom: 2px solid var(--c-border);
    box-shadow: 0 4px 14px rgba(40, 30, 20, 0.05);
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

@media (min-width: 992px) {
    .bookstore-navbar .navbar-collapse {
        flex-wrap: nowrap !important;
    }
    .bookstore-navbar .navbar-nav {
        flex-wrap: nowrap !important;
        align-items: center;
    }
}

.brand-crest-box {
    width: 36px;
    height: 36px;
    background: var(--c-forest);
    border: 2px solid var(--c-gold);
    color: var(--c-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.15rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    color: var(--c-forest);
    line-height: 1.1;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--c-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-link {
    font-weight: 500;
    color: var(--c-charcoal) !important;
    padding: 0.35rem 0.52rem !important;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-size: 0.86rem;
    white-space: nowrap !important;
    border-radius: 6px;
}

@media (min-width: 1400px) {
    .nav-link {
        padding: 0.38rem 0.72rem !important;
        font-size: 0.9rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .nav-link {
        padding: 0.3rem 0.38rem !important;
        font-size: 0.81rem;
    }
    .brand-subtitle {
        display: none !important;
    }
    .brand-title {
        font-size: 1.05rem;
    }
}

.nav-link:hover, .nav-link.active {
    color: var(--c-gold-hover) !important;
}

.search-input-group {
    background: #fff;
    border: 1px solid var(--c-border-dark);
    border-radius: 30px;
    overflow: hidden;
    padding: 1px 3px;
    max-width: 165px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, max-width 0.25s ease;
}
@media (min-width: 1400px) {
    .search-input-group {
        max-width: 215px;
    }
}
.search-input-group:focus-within {
    border-color: var(--c-forest);
    box-shadow: 0 0 0 3px rgba(23, 50, 36, 0.12);
    max-width: 220px;
}
.search-input-group input {
    border: none;
    box-shadow: none !important;
    font-size: 0.82rem;
    background: transparent;
    padding: 0.25rem 0.45rem;
}
.search-input-group .btn {
    border: none;
    background: transparent;
    color: var(--c-forest);
    padding: 0.25rem 0.5rem;
    min-height: auto;
}

/* =========================================================
   RESPONSIVE BUTTONS & TOUCH TARGETS (WCAG 44px Standards)
   ========================================================= */
.btn {
    font-size: clamp(0.84rem, 1.4vw, 0.95rem);
    padding: 0.5rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 50px;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    touch-action: manipulation;
    white-space: nowrap;
}

.btn-lg {
    font-size: clamp(0.92rem, 1.6vw, 1.05rem);
    padding: clamp(0.65rem, 1.6vw, 0.85rem) clamp(1.2rem, 2.5vw, 1.85rem);
    min-height: 48px;
}

.btn-sm {
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    min-height: 36px;
    white-space: nowrap;
}

.btn-forest {
    background-color: var(--c-forest);
    border-color: var(--c-forest);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.btn-forest:hover {
    background-color: var(--c-forest-dark);
    border-color: var(--c-forest-dark);
    color: var(--c-gold);
}

.btn-outline-forest {
    border-color: var(--c-forest);
    color: var(--c-forest);
    font-weight: 600;
}
.btn-outline-forest:hover {
    background-color: var(--c-forest);
    color: #fff;
}

.btn-gold {
    background-color: var(--c-gold);
    border-color: var(--c-gold);
    color: var(--c-forest-dark);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(207, 164, 68, 0.25);
}
.btn-gold:hover {
    background-color: var(--c-gold-hover);
    border-color: var(--c-gold-hover);
    color: #fff;
    box-shadow: 0 6px 16px rgba(207, 164, 68, 0.35);
}

/* =========================================================
   3D BOOK COVER COMPONENT (Fluid Breakpoint Proportions)
   ========================================================= */
.book-cover-3d {
    position: relative;
    display: inline-block;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 100%;
    transform-style: preserve-3d;
}

.book-cover-3d:hover {
    transform: translateY(-6px) rotateY(-5deg) scale(1.02);
}

/* Standard Medium Cover (Catalog Shelf Cards) */
.book-cover-md {
    width: 175px;
    height: 255px;
}

/* Large Cover (Hero Spotlight & Book Detail) */
.book-cover-lg {
    width: 245px;
    height: 355px;
}

/* Small Cover (Satchel Cart & Review Thumbnails) */
.book-cover-sm {
    width: 76px;
    height: 112px;
}

/* Breakpoint 1: Large Tablets & Small Laptops (992px - 1199px) */
@media (max-width: 1199.98px) {
    .book-cover-lg {
        width: 215px;
        height: 310px;
    }
    .book-cover-md {
        width: 160px;
        height: 235px;
    }
}

/* Breakpoint 2: Tablets (768px - 991px) */
@media (max-width: 991.98px) {
    .book-cover-lg {
        width: 195px;
        height: 280px;
    }
    .book-cover-md {
        width: 150px;
        height: 220px;
    }
}

/* Breakpoint 3: Mobile Devices (< 768px) */
@media (max-width: 767.98px) {
    .book-cover-lg {
        width: 175px;
        height: 250px;
    }
    .book-cover-md {
        width: 142px;
        height: 206px;
    }
    .book-cover-sm {
        width: 66px;
        height: 96px;
    }
}

/* Breakpoint 4: Compact Phones (< 576px) */
@media (max-width: 575.98px) {
    .book-cover-lg {
        width: 155px;
        height: 225px;
    }
    .book-cover-md {
        width: 132px;
        height: 192px;
    }
    .book-cover-sm {
        width: 58px;
        height: 84px;
    }
}

/* Breakpoint 5: Extra-Small Screens (< 380px: iPhone SE, Galaxy Fold) */
@media (max-width: 379.98px) {
    .book-cover-lg {
        width: 135px;
        height: 196px;
    }
    .book-cover-md {
        width: 118px;
        height: 172px;
    }
    .book-cover-sm {
        width: 52px;
        height: 76px;
    }
}

.book-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cover-primary) 0%, var(--cover-accent, #111) 100%);
    border-radius: 2px 7px 7px 2px;
    box-shadow: var(--shadow-book);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(8px, 2vw, 14px);
    box-sizing: border-box;
    transition: box-shadow 0.35s ease;
}

.book-front.book-front-has-image {
    padding: 0 !important;
    background: #121212;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 2px 7px 7px 2px;
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.book-cover-3d:hover .book-cover-img {
    transform: scale(1.03);
}

.book-front-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(8px, 2vw, 14px);
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.book-cover-3d:hover .book-front {
    box-shadow: var(--shadow-book-hover);
}

/* Spine edge highlight and shadow (book hinge) */
.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: clamp(7px, 1.5vw, 10px);
    background: linear-gradient(to right, rgba(0,0,0,0.55), rgba(0,0,0,0.1) 40%, rgba(255,255,255,0.2) 65%, rgba(0,0,0,0.25));
    border-radius: 2px 0 0 2px;
    z-index: 5;
    pointer-events: none;
}

/* Outer foil border */
.book-border-gold {
    border: 1.5px solid var(--cover-secondary, #d4af37);
    outline: 1px solid rgba(255, 255, 255, 0.15);
    outline-offset: -4px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: clamp(6px, 1.5vw, 12px) 6px 6px 6px;
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.08);
}

.book-header-icon {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--cover-secondary, #d4af37);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
    line-height: 1;
}

.book-cover-lg .book-header-icon {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.book-cover-sm .book-header-icon {
    font-size: 0.85rem;
}

.book-title-block {
    margin: 2px 0;
}

.book-title-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(0.72rem, 1.8vw, 0.88rem);
    color: #fffdf5;
    line-height: 1.25;
    display: block;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.book-cover-lg .book-title-text {
    font-size: clamp(0.95rem, 2.5vw, 1.3rem);
}

.book-cover-sm .book-title-text {
    font-size: 0.52rem;
}

.book-divider-ornament {
    color: var(--cover-secondary, #d4af37);
    font-size: 0.8rem;
    line-height: 1;
}

.book-author-text {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--cover-secondary, #e8d7a7);
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    letter-spacing: 0.04em;
    display: block;
}

.book-cover-lg .book-author-text {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
}

.book-cover-sm .book-author-text {
    font-size: 0.45rem;
}

.book-publisher-seal {
    font-size: clamp(0.48rem, 1vw, 0.55rem);
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    font-weight: 600;
}

.book-cover-sm .book-publisher-seal {
    display: none;
}

/* Diagonal sheen gloss */
.book-sheen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(125deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 40%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
    z-index: 3;
}

/* Ribbon marker bookmark hanging from bottom */
.book-ribbon {
    position: absolute;
    bottom: -10px;
    right: clamp(16px, 4vw, 28px);
    width: clamp(7px, 1.5vw, 9px);
    height: clamp(16px, 3vw, 22px);
    background: #9d2528;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.3);
    z-index: 4;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 80%, 0% 100%);
}

/* =========================================================
   CARDS & SHELVES (Responsive Layout & Spacing)
   ========================================================= */
.book-shelf-card {
    background-color: var(--c-cream-card);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
    overflow: hidden;
    position: relative;
}

.book-shelf-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(44, 22, 11, 0.12), 0 4px 10px rgba(0,0,0,0.06) !important;
    border-color: var(--c-gold);
}

.card-cover-wrapper {
    background: radial-gradient(circle at center, #fbf7ee 0%, #ebe0cd 100%);
    border-bottom: 1px solid var(--c-border);
    min-height: clamp(230px, 30vw, 290px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    position: relative;
    overflow: hidden;
}

.card-cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(14, 38, 26, 0.88) 0%, rgba(14, 38, 26, 0) 100%);
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 15;
    pointer-events: none;
}

.book-shelf-card:hover .card-cover-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-card-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--c-border);
    color: var(--c-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.btn-card-wishlist:hover {
    background: var(--c-forest);
    color: var(--c-gold);
    border-color: var(--c-forest);
    transform: scale(1.1);
}

.book-shelf-index {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--c-muted);
    background: var(--c-cream-alt);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--c-border);
}

.book-price-display {
    color: var(--c-forest);
    letter-spacing: -0.02em;
}

/* Bookshelf wood ledge effect with Brass Nameplate */
.bookshelf-ledge {
    height: clamp(14px, 2vw, 18px);
    background: linear-gradient(to bottom, #5d3c26 0%, #3d2315 50%, #25130b 100%);
    border-top: 3px solid #8e6241;
    box-shadow: 0 8px 18px rgba(0,0,0,0.32);
    margin-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
    position: relative;
    border-radius: 2px;
}
.bookshelf-ledge::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(0,0,0,0.22);
    filter: blur(5px);
}

.bookshelf-brass-plate {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ecd696 0%, #cfa444 40%, #a47c22 100%);
    color: #241407;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    padding: 2px 16px;
    border-radius: 2px;
    border: 1px solid #735118;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 3px 6px rgba(0,0,0,0.35);
    white-space: nowrap;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}
.bookshelf-brass-plate::before, .bookshelf-brass-plate::after {
    content: '•';
    color: #4a2d10;
    font-size: 0.65rem;
}

.book-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: clamp(0.6rem, 1.3vw, 0.68rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge-staff { background-color: var(--c-forest); color: var(--c-gold-soft); }
.badge-signed { background-color: var(--c-burgundy); color: #fff; }
.badge-month { background-color: var(--c-gold); color: var(--c-forest-dark); }
.badge-mystery { background-color: #634329; color: #fdedd2; }
.badge-rare { background-color: #21293c; color: #c4d6f4; }
.badge-world-bestseller {
    background: linear-gradient(135deg, #8a1f1d, #c23b22);
    color: #fff9e6;
    border: 1px solid rgba(255, 215, 0, 0.45);
    box-shadow: 0 2px 8px rgba(138, 31, 29, 0.35);
}
.badge-world-top {
    background: linear-gradient(135deg, #a67c1e, #d4af37);
    color: #173224;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.45);
}

.book-card-title {
    font-size: clamp(0.95rem, 1.8vw, 1.05rem);
    font-weight: 600;
    line-height: 1.35;
}
.book-card-title a:hover {
    color: var(--c-forest-light) !important;
}

/* Staff curator note (handwritten style sticker) */
.staff-curator-note {
    background: #fff8eb;
    border-left: 3px solid var(--c-gold);
    padding: clamp(5px, 1.2vw, 8px) clamp(8px, 1.5vw, 12px);
    border-radius: 0 4px 4px 0;
    font-family: var(--font-quote);
    font-size: clamp(0.82rem, 1.5vw, 0.9rem);
    color: #4a3e2c;
    line-height: 1.35;
}
.staff-curator-note .curator-name {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    color: var(--c-muted);
    font-weight: 600;
    margin-top: 3px;
    text-transform: uppercase;
}

/* =========================================================
   HERO SECTION (Rich Library Atmosphere & Ambient Lighting)
   ========================================================= */
.hero-bookstore {
    background: radial-gradient(circle at 75% 25%, rgba(207, 164, 68, 0.22) 0%, rgba(15, 39, 27, 0.95) 55%, #07170f 100%), #07170f;
    color: #f7f3ec;
    position: relative;
    overflow: hidden;
    padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem) 0;
    border-bottom: 3px solid var(--c-gold);
    box-shadow: inset 0 -20px 40px rgba(0,0,0,0.4);
}

.hero-bookstore::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(207, 164, 68, 0.12) 0%, transparent 50%),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70"><path d="M0 35 L35 0 L70 35 L35 70 Z" fill="none" stroke="%23ffffff" stroke-width="0.5" stroke-opacity="0.04"/></svg>');
    opacity: 0.85;
    pointer-events: none;
}

.hero-atmosphere-ticker {
    background: rgba(8, 23, 15, 0.75);
    border: 1px solid rgba(207, 164, 68, 0.4);
    border-radius: 30px;
    padding: 6px 18px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(0.72rem, 1.5vw, 0.8rem);
    color: var(--c-gold-soft);
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.hero-tag {
    font-family: var(--font-heading);
    color: var(--c-gold);
    letter-spacing: 0.18em;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    text-transform: uppercase;
    font-weight: 700;
}

.hero-title {
    font-size: clamp(2rem, 5vw + 0.5rem, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: clamp(0.98rem, 2vw + 0.2rem, 1.18rem);
    color: #d6e0d3;
    max-width: 600px;
    line-height: 1.7;
}

/* 3D Floating Book Fan-out Trio */
.hero-floating-stack {
    position: relative;
    display: inline-block;
    padding: 30px 40px;
}

.hero-floating-stack .stack-book-bg-left {
    position: absolute;
    left: -15px;
    top: 45px;
    transform: rotate(-10deg) scale(0.85);
    z-index: 1;
    opacity: 0.88;
    transition: transform 0.4s ease, opacity 0.4s ease;
    filter: drop-shadow(-8px 12px 18px rgba(0,0,0,0.5));
}

.hero-floating-stack .stack-book-bg-right {
    position: absolute;
    right: -15px;
    top: 45px;
    transform: rotate(10deg) scale(0.85);
    z-index: 1;
    opacity: 0.88;
    transition: transform 0.4s ease, opacity 0.4s ease;
    filter: drop-shadow(8px 12px 18px rgba(0,0,0,0.5));
}

.hero-floating-stack .stack-book-main {
    position: relative;
    z-index: 3;
    transform: scale(1.05);
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
    transition: transform 0.4s ease;
}

.hero-floating-stack:hover .stack-book-bg-left {
    transform: rotate(-16deg) translateX(-18px) scale(0.88);
    opacity: 1;
}

.hero-floating-stack:hover .stack-book-bg-right {
    transform: rotate(16deg) translateX(18px) scale(0.88);
    opacity: 1;
}

.hero-floating-stack:hover .stack-book-main {
    transform: scale(1.08) translateY(-6px);
}

/* =========================================================
   MOOD & GENRE SELECTOR (Interactive Reader Filter Bar)
   ========================================================= */
.mood-selector-container {
    background: var(--c-cream-card);
    border: 1px solid var(--c-border);
    border-radius: 50px;
    padding: 6px 10px;
    box-shadow: 0 8px 24px rgba(44, 22, 11, 0.06);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mood-selector-container::-webkit-scrollbar {
    display: none;
}

.mood-pill {
    background: transparent;
    border: 1px solid transparent;
    color: var(--c-charcoal);
    font-weight: 600;
    font-size: clamp(0.78rem, 1.4vw, 0.85rem);
    padding: 8px 18px;
    border-radius: 30px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mood-pill:hover {
    background: var(--c-cream-alt);
    color: var(--c-forest);
}

.mood-pill.active {
    background: var(--c-forest);
    color: var(--c-gold);
    box-shadow: 0 4px 12px rgba(15, 39, 27, 0.25);
    border-color: var(--c-forest);
}

/* Feature Pillars */
.feature-pillar {
    background: var(--c-cream-card);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: clamp(1.2rem, 2.5vw, 1.6rem);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}
.feature-pillar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--c-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.feature-pillar:hover {
    border-color: var(--c-gold);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(44, 22, 11, 0.08);
}
.feature-pillar:hover::before {
    opacity: 1;
}

.feature-pillar-icon {
    width: clamp(44px, 5vw, 50px);
    height: clamp(44px, 5vw, 50px);
    border-radius: 12px;
    background: #edf5f0;
    color: var(--c-forest);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.3rem, 2.5vw, 1.5rem);
    margin-bottom: 0.85rem;
    border: 1px solid rgba(15, 39, 27, 0.1);
}

/* =========================================================
   BLIND DATE MYSTERY INTERACTION
   ========================================================= */
.blind-date-banner {
    background: radial-gradient(circle at 80% 20%, #4a2d18 0%, #291509 60%, #170b04 100%);
    border: 2px dashed var(--c-gold);
    border-radius: 16px;
    color: #f7edd8;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 0 16px 36px rgba(0,0,0,0.35);
    position: relative;
    overflow: hidden;
}

.clue-envelope {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(207, 164, 68, 0.35);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.clue-envelope:hover {
    background: rgba(207, 164, 68, 0.15);
    border-color: var(--c-gold);
    transform: translateY(-2px);
}
.clue-envelope .clue-content {
    font-family: var(--font-quote);
    font-size: 1.05rem;
    color: #fcf1d8;
}

/* Excerpt quote block in detail page */
.book-excerpt-box {
    background: #fbf6ec;
    border-left: 4px solid var(--c-forest);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    line-height: 1.75;
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 3vw, 1.75rem);
    border-radius: 0 8px 8px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* Quick View Modal Styles */
.quick-view-modal-content {
    background-color: var(--c-cream-card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.qv-cover-container {
    background: radial-gradient(circle at center, #fbf7ee 0%, #ede3d1 100%);
    border-radius: 12px;
    border: 1px solid var(--c-border);
}
.qv-excerpt-card {
    background: var(--c-cream-alt);
    border-left: 3px solid var(--c-gold);
}
.qv-qty-btn {
    border-color: var(--c-border);
    color: var(--c-forest);
}
.qv-qty-btn:hover {
    background: var(--c-forest);
    color: #fff;
}

/* Literary Quote Parchment Card */
.literary-quote-card {
    background: #fdfaf3;
    border: 2px solid var(--c-border);
    outline: 1px solid rgba(207, 164, 68, 0.3);
    outline-offset: -6px;
    border-radius: 12px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    box-shadow: 0 8px 24px rgba(44, 22, 11, 0.06);
}
.literary-quote-card::before {
    content: '“';
    position: absolute;
    top: -15px;
    left: 25px;
    font-family: var(--font-serif);
    font-size: 4rem;
    color: var(--c-gold);
    line-height: 1;
}

/* =========================================================
   FOOTER (Fluid Spacing & Clean Links)
   ========================================================= */
.bookstore-footer {
    background: #111d16;
    color: #b5c2b9;
    border-top: 3px solid var(--c-gold);
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2rem) 0;
    font-size: 0.92rem;
}

.bookstore-footer h5 {
    color: #f3efe6;
    font-family: var(--font-heading);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}
.bookstore-footer h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--c-gold);
}

.bookstore-footer a {
    color: #b5c2b9;
    text-decoration: none;
    transition: color 0.2s ease;
}
.bookstore-footer a:hover {
    color: var(--c-gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.5rem;
    margin-top: clamp(2rem, 4vw, 3rem);
    font-size: 0.825rem;
}

/* Toast */
.toast-cart-custom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1080;
    background: var(--c-forest-dark);
    color: #fff;
    border: 1px solid var(--c-gold);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* =========================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Margins, Paddings, Buttons, Typography & Breakpoints
   ========================================================= */

/* Tablets & Below (max-width: 991.98px) */
@media (max-width: 991.98px) {
    /* Navbar navigation on mobile & tablet */
    .navbar-collapse {
        background: var(--c-cream-card);
        padding: 1.25rem;
        border-radius: 12px;
        margin-top: 0.85rem;
        border: 1px solid var(--c-border);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    .search-input-group {
        margin-bottom: 0.85rem !important;
        width: 100%;
    }

    /* Hero adjustments */
    .hero-bookstore {
        text-align: center;
        padding: clamp(2.5rem, 5vw, 3.5rem) 0;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-floating-stack {
        margin-top: 1.5rem;
        padding: 20px;
    }

    /* Catalog sidebar */
    .catalog-filter-sticky {
        position: static !important;
        margin-bottom: 1.5rem;
    }

    /* Book detail sticky column */
    .position-sticky {
        position: static !important;
    }
}

/* Mobile Devices & Phablets (max-width: 767.98px) */
@media (max-width: 767.98px) {
    /* Fluid Section Vertical Spacing */
    section {
        padding-top: clamp(2rem, 4vw, 3rem) !important;
        padding-bottom: clamp(2rem, 4vw, 3rem) !important;
    }

    /* Card Paddings on Mobile (exempt book-shelf-card so cover aligns flush) */
    .card:not(.book-shelf-card) {
        padding: clamp(0.95rem, 2.5vw, 1.35rem);
    }
    .book-shelf-card {
        padding: 0 !important;
    }

    /* Buttons inside Hero & Callouts take full width cleanly */
    .hero-bookstore .d-flex.flex-column.flex-sm-row {
        gap: 0.75rem !important;
    }
    .hero-bookstore .btn {
        width: 100% !important;
        min-height: 46px;
    }

    /* Book Shelf Card spacing */
    .card-cover-wrapper {
        min-height: 230px;
        padding: 0.85rem;
    }

    /* Touch screen overlay for Quick View: keep buttons accessible */
    .card-cover-overlay {
        opacity: 0;
    }
    .book-shelf-card:active .card-cover-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    /* Bookshelf brass nameplates on mobile */
    .bookshelf-brass-plate {
        font-size: 0.58rem;
        padding: 2px 10px;
        letter-spacing: 0.1em;
        max-width: 88%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Quick View Modal padding */
    .modal-body {
        padding: 1.25rem !important;
    }

    /* Satchel Cart summary */
    .cart-summary-card {
        margin-top: 1rem;
    }
}

/* Small Phones (< 576px) */
@media (max-width: 575.98px) {
    /* Top announcement notice */
    .top-notice-bar {
        font-size: 0.72rem;
        padding: 0.35rem 0.5rem;
        line-height: 1.4;
    }

    /* Brand Header title */
    .brand-title {
        font-size: 1.1rem;
    }
    .brand-crest-box {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
    }

    /* Hero Floating Stack on phones */
    .hero-floating-stack {
        padding: 10px 0;
    }
    .hero-floating-stack .stack-book-bg-left,
    .hero-floating-stack .stack-book-bg-right {
        display: none !important;
    }
    .hero-floating-stack .stack-book-main {
        transform: none !important;
    }

    /* Mood Selector container */
    .mood-selector-container {
        padding: 4px 6px;
        gap: 4px;
    }
    .mood-pill {
        font-size: 0.76rem;
        padding: 6px 14px;
    }

    /* Card Cover Wrapper */
    .card-cover-wrapper {
        min-height: 200px;
        padding: 0.65rem;
    }

    /* Touch-friendly Form Controls (Prevents iOS auto-zoom on inputs < 16px) */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px !important;
        padding: 0.55rem 0.85rem;
        border-radius: 8px;
    }

    /* All Interactive Touch Targets */
    .btn {
        min-height: 44px;
        font-size: 0.88rem;
        padding: 0.5rem 1.1rem;
    }
    .btn-sm {
        min-height: 38px;
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
    }

    /* Bookshelf ledge height and brass plate */
    .bookshelf-ledge {
        height: 12px;
        margin-bottom: 1.5rem;
    }
    .bookshelf-brass-plate {
        font-size: 0.54rem;
        padding: 1px 8px;
        letter-spacing: 0.06em;
        top: -8px;
        max-width: 92%;
    }

    /* Excerpt Box */
    .book-excerpt-box {
        padding: 0.85rem 1rem;
        font-size: 0.92rem;
    }

    /* Blind Date interactive clues */
    .clue-envelope {
        padding: 8px 10px;
    }
    .clue-envelope .clue-placeholder,
    .clue-envelope .clue-hidden {
        font-size: 0.82rem;
    }

    /* Book detail layout */
    .book-detail-main-cover {
        padding: 1.25rem !important;
    }

    /* Mobile Cart Items */
    .mobile-cart-item {
        padding: 0.85rem 0;
        border-bottom: 1px solid var(--c-border);
    }

    /* Footer adjustments */
    .bookstore-footer {
        padding-top: 2rem !important;
        padding-bottom: 1.5rem !important;
    }
    .footer-bottom {
        text-align: center;
        justify-content: center !important;
    }
}

/* Extra-Small Screens (max-width: 379.98px: iPhone SE, Galaxy Z Fold) */
@media (max-width: 379.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero-title {
        font-size: 1.55rem !important;
    }
    .hero-subtitle {
        font-size: 0.85rem !important;
    }

    /* Book card title */
    .book-card-title {
        font-size: 0.88rem !important;
    }

    .card-cover-wrapper {
        min-height: 185px;
        padding: 0.5rem;
    }

    .bookshelf-brass-plate {
        font-size: 0.5rem;
        padding: 1px 6px;
    }
}

/* Touch Devices (Hover Disabled / Pointer Coarse) */
@media (hover: none) and (pointer: coarse) {
    /* Display the Quick View and Action buttons without requiring hover */
    .card-cover-overlay {
        display: none !important;
    }
    .btn-quick-view-sm {
        display: inline-flex !important;
        width: 38px !important;
        height: 38px !important;
    }
}

/* Fluid Typography, Clamping & Touch Enhancements */
.book-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
    line-height: 1.25;
}

.book-card-title a {
    color: inherit;
    text-decoration: none;
}
.book-card-title a:hover {
    color: var(--c-burgundy);
}

.card-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb {
    flex-wrap: wrap;
    row-gap: 4px;
}

.breadcrumb-item {
    font-size: clamp(0.78rem, 1.5vw, 0.88rem);
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Accessible and smooth focus outline for touch/keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--c-gold) !important;
    outline-offset: 2px;
}

/* Allow multi-line buttons when needed */
.btn.text-start,
.btn-multiline,
.btn-check + .btn {
    white-space: normal !important;
}

/* =========================================================
   BINDING & FORMAT SELECTION CARDS (Book Detail)
   ========================================================= */
.format-select-card {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    text-align: left !important;
    white-space: normal !important;
    border-radius: 10px !important;
    padding: 0.75rem 0.95rem !important;
    min-height: 64px !important;
    height: 100%;
    cursor: pointer;
    border: 1.5px solid var(--c-border-dark, #ded5c4);
    background: #fff;
    color: var(--c-dark, #2b2b2b);
    position: relative;
    transition: all 0.22s ease-in-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.format-select-card:hover {
    border-color: var(--c-forest);
    background: var(--c-cream-card, #faf5eb);
    transform: translateY(-1px);
}

.btn-check:checked + .format-select-card {
    border-color: var(--c-forest) !important;
    background: linear-gradient(135deg, #fdfbf7 0%, #f4ece0 100%) !important;
    box-shadow: 0 0 0 2px var(--c-forest), 0 4px 12px rgba(15, 39, 27, 0.12);
}

.format-select-card .format-title {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--c-forest, #0f271b);
    line-height: 1.3;
    margin-bottom: 3px;
    padding-right: 22px;
    word-break: normal;
    overflow-wrap: break-word;
}

.format-select-card .format-meta {
    display: block;
    font-size: 0.78rem;
    color: #5c625e;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
}

.format-select-card .format-check-icon {
    position: absolute;
    top: 9px;
    right: 10px;
    color: var(--c-forest);
    font-size: 1rem;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-check:checked + .format-select-card .format-check-icon {
    opacity: 1;
    transform: scale(1);
}

.btn-check:focus-visible + .format-select-card {
    outline: 2px solid var(--c-gold);
    outline-offset: 2px;
}




/* =========================================================
   LEGAL & INFORMATION PAGES (Terms, Privacy, Contact)
   ========================================================= */
.hover-bg-light {
    transition: background-color 0.2s ease, color 0.2s ease;
}
.hover-bg-light:hover {
    background-color: var(--c-cream-alt) !important;
    color: var(--c-forest-dark) !important;
    font-weight: 600;
}
section[id^="section-"], section[id^="priv-"] {
    scroll-margin-top: 100px;
}
@media print {
    .bookstore-navbar,
    .top-notice-bar,
    .bookstore-footer,
    .sticky-top,
    .btn,
    .d-print-none {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}
