/* ══════════════════════════════════════════════════════
   Vashti's Creative Ideas — Shared Stylesheet
   Common styles loaded across all pages.
   ══════════════════════════════════════════════════════ */

/* ── Global Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

/* ══════════════════════════════════════════
   Navigation Bar
   ══════════════════════════════════════════ */

nav {
    background-color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    flex-wrap: wrap;
}

nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    background-color: #34495e;
    color: #3498db;
}

nav ul li a.active {
    background-color: #3498db;
    color: white;
}

/* ── Nav Dropdown ── */
.nav-dropdown {
    position: relative;
}

/* Disabled nav item (e.g. Calendars - Coming Soon) */
.nav-disabled {
    color: #8e9aab;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    cursor: default;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coming-soon-label {
    font-style: normal;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    color: #f1c40f;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    white-space: nowrap;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    min-width: 180px;
    padding: 0.5rem 0;
    flex-direction: column;
    gap: 0;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.dropdown-open .dropdown-menu {
    display: flex;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
    border-radius: 0;
    font-size: 1rem;
}

.dropdown-menu li a:hover {
    background-color: #34495e;
    color: #3498db;
}

.dropdown-menu li a.active {
    background-color: #3498db;
    color: white;
}

/* ── Hamburger Toggle (mobile) ── */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    z-index: 1002;
}

.nav-hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #ecf0f1;
    border-radius: 3px;
    transition: transform 0.3s, opacity 0.3s;
}

nav.nav-open .nav-hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

nav.nav-open .nav-hamburger span:nth-child(2) {
    opacity: 0;
}

nav.nav-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Blog page nav layout */
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    gap: 1.5rem;
}

.nav-brand {
    color: #ecf0f1;
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    white-space: nowrap;
    opacity: 0.85;
}

.nav-brand::after {
    content: '|';
    margin-left: 1.5rem;
    opacity: 0.4;
}

/* ══════════════════════════════════════════
   Footer
   ══════════════════════════════════════════ */

footer {
    text-align: center;
    padding: 2rem;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 0.95rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════
   Cart Badge & Success Toast
   ══════════════════════════════════════════ */

.cart-nav-btn {
    position: relative;
    font-size: 1.3rem !important;
    background: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.cart-success-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #d4edda;
    color: #155724;
    padding: 1rem 2rem;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2001;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.4s, transform 0.4s;
    pointer-events: none;
}

.cart-success-toast.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* ══════════════════════════════════════════
   Keyboard Focus Styles
   ══════════════════════════════════════════ */
.filter-btn:focus-visible,
.modal-close:focus-visible,
.qty-btn:focus-visible,
.add-to-cart-btn:focus-visible,
.modal-shop-btn:focus-visible,
.cart-nav-btn:focus-visible,
.visit-store-btn:focus-visible,
.column-btn:focus-visible {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
}

/* ══════════════════════════════════════════
   Bookshelf Component (index + books pages)
   ══════════════════════════════════════════ */

.bookshelf {
    background: linear-gradient(180deg, #f7f3ee 0%, #d4b896 100%);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.shelf {
    background: linear-gradient(180deg, #8b4513 0%, #654321 100%);
    border-radius: 8px;
    padding: 25px 20px;
    margin-bottom: 20px;
    position: relative;
    box-shadow:
        inset 0 -3px 6px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
}

.shelf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4a574 0%, #c9984a 50%, #d4a574 100%);
    border-radius: 8px 8px 0 0;
}

.shelf::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, #6b3410 0%, #4a2408 100%);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.shelf:last-child {
    margin-bottom: 0;
}

.books {
    display: flex;
    gap: 15px;
    position: relative;
    z-index: 1;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-bottom: 8px;
}

/* Hide scrollbar but keep functionality */
.books::-webkit-scrollbar {
    height: 6px;
}

.books::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.books::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.books::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.book {
    width: 180px;
    min-width: 180px;
    height: 240px;
    border-radius: 4px;
    box-shadow:
        2px 2px 8px rgba(0, 0, 0, 0.4),
        -1px -1px 3px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.book:not([data-book-id]) {
    display: none;
    cursor: default;
}

.book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(110deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%,
        transparent 100%);
    pointer-events: none;
}

.book:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        4px 4px 16px rgba(0, 0, 0, 0.5),
        -2px -2px 6px rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.book img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1.5;
}

.book:hover .book-info {
    opacity: 1;
}

.book-info h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #f4e4c1;
}

.book-info p {
    font-size: 0.75rem;
    margin: 0;
}

/* Book placeholder colours */
.book-1  { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%); }
.book-2  { background: linear-gradient(135deg, #4ecdc4 0%, #44a0a0 100%); }
.book-3  { background: linear-gradient(135deg, #ffe66d 0%, #ffcc00 100%); }
.book-4  { background: linear-gradient(135deg, #a8e6cf 0%, #7bcfa5 100%); }
.book-5  { background: linear-gradient(135deg, #ff8b94 0%, #ff6b7a 100%); }
.book-6  { background: linear-gradient(135deg, #b4a7d6 0%, #9d8cc9 100%); }
.book-7  { background: linear-gradient(135deg, #ffd3b6 0%, #ffb88c 100%); }
.book-8  { background: linear-gradient(135deg, #dcedc1 0%, #c5e1a5 100%); }
.book-9  { background: linear-gradient(135deg, #f8b195 0%, #f67280 100%); }
.book-10 { background: linear-gradient(135deg, #c06c84 0%, #a05679 100%); }
.book-11 { background: linear-gradient(135deg, #6c5b7b 0%, #5a4a68 100%); }
.book-12 { background: linear-gradient(135deg, #355c7d 0%, #2a4a61 100%); }

/* ══════════════════════════════════════════
   Book Card Layout (bookstore + books modal)
   ══════════════════════════════════════════ */

.book-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.book-row {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    align-items: start;
}

.book-image-section {
    text-align: center;
}

.book-image {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.book-image:hover {
    transform: scale(1.05);
}

/* Fallback when a book cover image fails to load */
.book-image-section.img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #e8e0d4 0%, #d4c5b0 100%);
    border-radius: 8px;
    color: #7a6e5d;
    font-size: 0.95rem;
    font-style: italic;
}

.book-image-section.img-fallback::after {
    content: '\1F4D6  Image unavailable';
}

.book-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.book-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.book-author {
    font-size: 1rem;
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 1rem;
}

.book-description {
    color: #555;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.book-specs {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: start;
    column-gap: 2rem;
    row-gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ecf0f1;
}

.spec-item {
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
}

.spec-label {
    font-weight: 600;
    color: #2c3e50;
    flex-shrink: 0;
}

.spec-value {
    color: #555;
}

.purchase-section {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.price-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
}

.quantity-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.quantity-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.quantity-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    background-color: #3498db;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.qty-display {
    font-size: 1.2rem;
    font-weight: 600;
    width: 60px;
    text-align: center;
    padding: 0.4rem 0.2rem;
    background-color: white;
    border-radius: 5px;
    border: 2px solid #3498db;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-display::-webkit-outer-spin-button,
.qty-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-price-row {
    width: 100%;
    text-align: center;
    padding: 1rem;
    background-color: white;
    border-radius: 5px;
}

.total-label {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.total-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #27ae60;
}

.add-to-cart-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* ══════════════════════════════════════════
   Reviews
   ══════════════════════════════════════════ */

/* ── Stars (read-only) ── */
.vr-stars {
    display: inline-flex;
    gap: 1px;
    vertical-align: middle;
}

.vr-star {
    line-height: 1;
}

.vr-star--full  { color: #f5a623; }
.vr-star--half  { color: #f5a623; opacity: 0.55; }
.vr-star--empty { color: #d0d0d0; }

.vr-stars--sm .vr-star { font-size: 0.95rem; }
.vr-stars--md .vr-star { font-size: 1.2rem; }
.vr-stars--lg .vr-star { font-size: 1.5rem; }

.vr-count {
    font-size: 0.82rem;
    color: #888;
    margin-left: 0.4rem;
    vertical-align: middle;
}

a.vr-count-link {
    color: #2980b9;
    text-decoration: none;
    cursor: pointer;
}
a.vr-count-link:hover {
    text-decoration: underline;
}

/* ── Star Picker (interactive) ── */
.vr-star-picker {
    display: inline-flex;
    gap: 2px;
    cursor: pointer;
}

.vr-pick-star {
    font-size: 1.7rem;
    color: #d0d0d0;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 1;
}

.vr-pick-star:hover,
.vr-pick-star.active {
    color: #f5a623;
    transform: scale(1.15);
}

/* ── Review Section ── */
.vr-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.vr-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.vr-summary.vr-toggle {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    background: #f8f6f3;
    border: 1px solid #e0d6cc;
}

.vr-summary.vr-toggle:hover {
    background: #f0ebe4;
    border-color: #8b6e52;
}

.vr-chevron {
    margin-left: auto;
    font-size: 1.1rem;
    color: #8b6e52;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.vr-toggle[aria-expanded="true"] .vr-chevron {
    transform: rotate(180deg);
}

.vr-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, margin 0.35s ease;
    margin-top: 0;
}

.vr-collapsible.vr-open {
    margin-top: 1rem;
}

.vr-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.vr-avg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vr-avg-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f5a623;
}

.vr-no-reviews {
    font-size: 0.88rem;
    color: #999;
    font-style: italic;
}

/* ── Review List ── */
.vr-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.3rem;
}

.vr-review {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.vr-review:last-child {
    border-bottom: none;
}

.vr-review-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.vr-reviewer {
    font-weight: 600;
    font-size: 0.88rem;
    color: #2c3e50;
}

.vr-date {
    font-size: 0.78rem;
    color: #aaa;
}

.vr-review-text {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.6;
    margin: 0.3rem 0 0;
}

/* ── Write-a-Review Form ── */
.vr-write-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 5px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.vr-write-btn:hover {
    background: #2980b9;
}

.vr-form {
    background: #fafafb;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 0.8rem;
}

.vr-form-row {
    margin-bottom: 0.8rem;
}

.vr-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.vr-input {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.92rem;
    transition: border-color 0.2s;
}

.vr-input:focus {
    outline: none;
    border-color: #3498db;
}

.vr-textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.92rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
}

.vr-textarea:focus {
    outline: none;
    border-color: #3498db;
}

.vr-form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.vr-submit-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.6rem 1.6rem;
    border-radius: 5px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.vr-submit-btn:hover {
    background: #229954;
}

.vr-cancel-btn {
    background: none;
    border: 1px solid #ddd;
    color: #888;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.vr-cancel-btn:hover {
    border-color: #bbb;
    color: #555;
}

/* ── Inline star badge (bookstore / card grids) ── */
.vr-inline-badge {
    margin-top: 0.3rem;
}

/* ══════════════════════════════════════════
   Responsive — Shared Breakpoints
   ══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .book-row {
        grid-template-columns: 200px 1fr;
        gap: 1.5rem;
    }

    .purchase-section {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-around;
    }

    .quantity-control {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    /* ── Mobile nav / hamburger ── */
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        padding: 0.8rem 1rem;
    }

    .nav-hamburger {
        display: flex;
    }

    nav > ul {
        display: none;
        flex-direction: column;
        flex: 0 0 100%;
        gap: 0;
        padding: 0.5rem 0 0;
    }

    nav.nav-open > ul {
        display: flex;
    }

    .nav-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
    }

    .nav-brand {
        flex: 1;
    }

    .nav-inner > ul {
        display: none;
        flex-direction: column;
        flex: 0 0 100%;
        gap: 0;
        padding: 0.5rem 0 0;
    }

    nav.nav-open .nav-inner > ul {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        display: block;
        padding: 0.75rem 1.5rem;
        border-radius: 0;
        text-align: center;
    }

    /* Mobile dropdown — tap toggle only */
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        min-width: 0 !important;
        background: #34495e !important;
        border-radius: 0 !important;
        width: 100%;
        padding: 0;
    }

    .nav-dropdown:hover .dropdown-menu {
        display: none;
    }

    .nav-dropdown.dropdown-open .dropdown-menu {
        display: flex;
    }

    .dropdown-menu li a {
        padding: 0.65rem 2rem;
    }

    /* ── Existing responsive rules ── */
    .book-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }

    .book-details {
        padding-right: 0.5rem;
    }

    .book-image-section {
        display: flex;
        justify-content: center;
    }

    .book-specs {
        grid-template-columns: 1fr;
    }

    .purchase-section {
        flex-direction: column;
        align-items: center;
        padding: 1.5rem;
    }

    .purchase-section .quantity-control {
        width: auto;
        align-items: center;
    }
}

/* ══════════════════════════════════════════
   Shared Design Tokens
   ══════════════════════════════════════════ */

:root {
    --cream: #f7f3ee;
    --white: #ffffff;
    --dark: #1a1a1a;
    --mid: #444444;
    --light: #888888;
    --border: #e2ddd8;
    --hover-bg: #f0ebe4;
    --accent: #c0392b;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 12px 35px rgba(0,0,0,0.15);
}

/* ══════════════════════════════════════════
   Banner / Bookshelf Spine Component
   Shared across index, index1, and books pages.
   ══════════════════════════════════════════ */

.banner {
    background: linear-gradient(135deg, #f7f3ee 0%, #e8d5b5 100%);
    padding: 20px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    width: 100%;
}

.banner-books {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 1;
    min-width: 0;
    perspective: 600px;
    position: relative;
    padding-bottom: 6px;
}

/* Shelf surface beneath books */
.banner-books::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    right: -8px;
    height: 6px;
    background: linear-gradient(180deg, #8b6e52 0%, #6b5240 40%, #5a4535 100%);
    border-radius: 0 0 2px 2px;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.banner-books.left {
    justify-content: flex-end;
}

.banner-books.right {
    justify-content: flex-start;
}

.banner-book {
    border-radius: 2px 4px 4px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transform-origin: bottom center;
    box-shadow:
        1px 1px 2px rgba(0,0,0,0.4),
        2px 2px 4px rgba(0,0,0,0.2),
        4px 4px 8px rgba(0,0,0,0.1),
        inset -4px 0 8px rgba(0,0,0,0.25),
        inset 4px 0 8px rgba(255,255,255,0.06),
        inset 0 2px 4px rgba(255,255,255,0.05),
        inset 0 -2px 4px rgba(0,0,0,0.15);
}

/* Natural lean — each book tilts slightly */
.banner-books.left .banner-book:nth-child(1) { transform: rotate(-2.5deg); }
.banner-books.left .banner-book:nth-child(2) { transform: rotate(-1.5deg); }
.banner-books.left .banner-book:nth-child(3) { transform: rotate(-0.5deg); }
.banner-books.left .banner-book:nth-child(4) { transform: rotate(0.3deg); }
.banner-books.right .banner-book:nth-child(1) { transform: rotate(-0.3deg); }
.banner-books.right .banner-book:nth-child(2) { transform: rotate(0.5deg); }
.banner-books.right .banner-book:nth-child(3) { transform: rotate(1.5deg); }
.banner-books.right .banner-book:nth-child(4) { transform: rotate(2.5deg); }

/* Rounded spine curvature — left highlight strip */
.banner-book::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    background: linear-gradient(90deg,
        rgba(255,255,255,0.22) 0%,
        rgba(255,255,255,0.08) 30%,
        rgba(255,255,255,0.02) 60%,
        transparent 100%);
    z-index: 4;
    pointer-events: none;
}

/* Page block — right edge with realistic paper lines */
.banner-book::after {
    content: '';
    position: absolute;
    right: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.08), transparent 40%),
        repeating-linear-gradient(
            180deg,
            #f5f0e6 0px,
            #ebe5d8 0.5px,
            #f2ece0 1px
        );
    border-right: 1px solid rgba(0,0,0,0.1);
    border-radius: 0 1px 1px 0;
    z-index: 4;
}

/* Cloth/leather texture overlay */
.spine-texture {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 3;
}

/* Headband — colored strip at top */
.banner-book .spine-edge-top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    z-index: 5;
    pointer-events: none;
    border-radius: 2px 4px 0 0;
}

/* Tailband — bottom edge */
.banner-book .spine-edge-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(0deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.05) 100%);
    z-index: 5;
    pointer-events: none;
    border-radius: 0 0 4px 2px;
}

/* Gold/accent decorative raised bands */
.spine-band {
    position: absolute;
    left: 15%;
    right: 15%;
    height: 1.5px;
    z-index: 5;
    pointer-events: none;
    border-radius: 1px;
}

.spine-band.top { top: 12%; }
.spine-band.bottom { bottom: 12%; }

.spine-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 14px 0;
    position: relative;
    z-index: 4;
    font-family: 'Georgia', 'Palatino Linotype', 'Book Antiqua', serif;
}

.banner-book.size-sm { width: 30px; height: 190px; }
.banner-book.size-sm .spine-title { font-size: 0.48rem; }
.banner-book.size-md { width: 38px; height: 220px; }
.banner-book.size-md .spine-title { font-size: 0.56rem; }
.banner-book.size-lg { width: 44px; height: 250px; }
.banner-book.size-lg .spine-title { font-size: 0.63rem; }

/* ── Spine Colors (CSS custom properties for DRY theming) ── */
.spine-engraved {
    --spine-base: #7a1e48; --spine-dark: #5a1533; --spine-mid: #8f2858; --spine-end: #501230;
    --spine-text: #e8c878; --spine-glow: rgba(232,200,120,0.4); --spine-band-c: rgba(232,200,120,0.6);
    --spine-edge: #e8c878; --spine-edge-fade: rgba(232,200,120,0.2);
}
.spine-transition {
    --spine-base: #24503f; --spine-dark: #16352c; --spine-mid: #2f604f; --spine-end: #16352c;
    --spine-text: #c8ddd4; --spine-glow: rgba(200,221,212,0.3); --spine-band-c: rgba(200,221,212,0.5);
    --spine-edge: #c8ddd4; --spine-edge-fade: rgba(200,221,212,0.2);
}
.spine-newwine {
    --spine-base: #4a2368; --spine-dark: #30174a; --spine-mid: #5e2f86; --spine-end: #30174a;
    --spine-text: #d4b068; --spine-glow: rgba(212,176,104,0.5); --spine-band-c: rgba(212,176,104,0.6);
    --spine-edge: #d4b068; --spine-edge-fade: rgba(212,176,104,0.2);
}
.spine-notbroken {
    --spine-base: #9a7209; --spine-dark: #7a5807; --spine-mid: #bc8a0c; --spine-end: #7a5807;
    --spine-text: #fff5dc; --spine-glow: rgba(255,245,220,0.4); --spine-band-c: rgba(255,245,220,0.5);
    --spine-edge: #e8d8a0; --spine-edge-fade: rgba(232,216,160,0.2);
}
.spine-father {
    --spine-base: #142f4a; --spine-dark: #0e2236; --spine-mid: #1c405e; --spine-end: #0e2236;
    --spine-text: #c9a96e; --spine-glow: rgba(201,169,110,0.5); --spine-band-c: rgba(201,169,110,0.6);
    --spine-edge: #c9a96e; --spine-edge-fade: rgba(201,169,110,0.2);
}
.spine-eyes {
    --spine-base: #2a2a2a; --spine-dark: #1a1a1a; --spine-mid: #3e3e3e; --spine-end: #1a1a1a;
    --spine-text: #c0c0c0; --spine-glow: rgba(192,192,192,0.4); --spine-band-c: rgba(160,160,160,0.4);
    --spine-edge: #888; --spine-edge-fade: rgba(136,136,136,0.2);
}
.spine-created {
    --spine-base: #be7a35; --spine-dark: #945c28; --spine-mid: #d88e42; --spine-end: #945c28;
    --spine-text: #fff0d0; --spine-glow: rgba(255,240,208,0.4); --spine-band-c: rgba(255,240,208,0.5);
    --spine-edge: #e8d0a0; --spine-edge-fade: rgba(232,208,160,0.2);
}
.spine-iamher {
    --spine-base: #aa4868; --spine-dark: #80364f; --spine-mid: #c85a7e; --spine-end: #80364f;
    --spine-text: #fce0e8; --spine-glow: rgba(252,224,232,0.4); --spine-band-c: rgba(252,224,232,0.5);
    --spine-edge: #fce0e8; --spine-edge-fade: rgba(252,224,232,0.2);
}

/* Shared spine rendering using variables */
.banner-book[class*="spine-"] {
    background:
        radial-gradient(ellipse at 25% 50%, rgba(255,255,255,0.07) 0%, transparent 70%),
        linear-gradient(90deg,
            var(--spine-dark) 0%, var(--spine-base) 8%, var(--spine-mid) 25%,
            var(--spine-base) 50%, var(--spine-base) 75%,
            var(--spine-dark) 92%,
            var(--spine-end) 100%);
}
.banner-book[class*="spine-"] .spine-title {
    color: var(--spine-text);
    text-shadow: 0 0 2px var(--spine-glow), 0 1px 1px rgba(0,0,0,0.5);
}
.banner-book[class*="spine-"] .spine-band {
    background: linear-gradient(90deg, transparent, var(--spine-band-c), transparent);
}
.banner-book[class*="spine-"] .spine-edge-top {
    background: linear-gradient(180deg, var(--spine-edge) 0%, var(--spine-edge-fade) 100%);
}

.logo-banner {
    height: 300px;
    width: auto;
    margin: 0 20px;
    flex-shrink: 0;
    max-width: 50%;
}

/* ── Banner Responsive ── */

@media (max-width: 1024px) {
    .banner { padding: 15px 20px; }
    .banner-book.size-sm { width: 24px; height: 140px; }
    .banner-book.size-sm .spine-title { font-size: 0.42rem; }
    .banner-book.size-md { width: 30px; height: 160px; }
    .banner-book.size-md .spine-title { font-size: 0.48rem; }
    .banner-book.size-lg { width: 35px; height: 180px; }
    .banner-book.size-lg .spine-title { font-size: 0.52rem; }
    .logo-banner { height: 200px; width: auto; }
}

@media (max-width: 768px) {
    .banner { padding: 12px 10px; }
    .banner-book.size-sm { width: 18px; height: 100px; }
    .banner-book.size-sm .spine-title { font-size: 0.36rem; }
    .banner-book.size-md { width: 22px; height: 115px; }
    .banner-book.size-md .spine-title { font-size: 0.4rem; }
    .banner-book.size-lg { width: 26px; height: 130px; }
    .banner-book.size-lg .spine-title { font-size: 0.44rem; }
    .logo-banner { height: 150px; width: auto; margin: 0 10px; }
}

@media (max-width: 640px) {
    .banner {
        flex-direction: column;
        gap: 10px;
        padding: 15px 10px;
    }
    .banner-books {
        display: none;
    }
    .logo-banner { height: 120px; width: auto; margin: 0; max-width: 80%; }
}

/* ══════════════════════════════════════════
   Scroll-to-Top Button
   ══════════════════════════════════════════ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border: 2px solid #ecf0f1;
    border-radius: 50%;
    background: #2c3e50;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .scroll-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

