:root {
    --primary: #3B6255; /* Deep forest green */
    --primary-hover: #2D4A40;
    --primary-light: #CBDED3; /* Light sage */
    --accent-gold: #D2C49E; /* Warm gold */
    --text-main: #2A2F2C;
    --text-muted: #5F6B64;
    --link-blue: #8BA49A; /* Sage green for links */
    --border: #E2DFDA;
    --border-dark: #C9C4BD;
    --bg-light: #F5F4F2;
    --surface: #ffffff;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--surface);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* ==============================
   HEADER (Waterstones Style)
   ============================== */
.site-header {
    background-color: var(--surface);
    width: 100%;
}

/* Util Bar (Top thin line) */
.header-util {
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.5rem 0;
}
.util-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.util-left a, .util-right a {
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 0 0.5rem;
}
.util-left a:hover, .util-right a:hover {
    color: var(--text-main);
}
.join-plus { color: #3B6255 !important; font-weight: 600; }
.join-plus i { font-weight: normal; }

/* Logo Section */
.header-logo {
    padding: 1.5rem 0;
}
.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.header-search-cart {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    margin-left: 4rem;
}

/* Main Navigation Row */
.main-nav {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.nav-list > li {
    position: static;
}
.nav-list > li > a,
.nav-list > li > .nav-item-wrapper > a {
    display: block;
    padding: 0.7rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    text-decoration: none;
}
.nav-list > li:first-child > a,
.nav-list > li:first-child > .nav-item-wrapper > a {
    border-left: 1px solid var(--border);
}
.nav-list > li > a:hover,
.nav-list > li > .nav-item-wrapper > a:hover {
    color: var(--primary);
}
.nav-list > li.active > a,
.nav-list > li.active > .nav-item-wrapper > a {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
.nav-list > li.mega-open > a,
.nav-list > li.mega-open > .nav-item-wrapper > a {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
}
.mobile-dropdown-icon {
    display: none;
}
.nav-item-wrapper {
    display: block;
    width: 100%;
}
.mega-menu-list {
    width: 100%;
    column-count: 4;
    column-gap: 4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.mega-menu-list > li {
    margin-bottom: 0.75rem;
    break-inside: avoid;
}
.mega-menu-list > li > a {
    color: var(--text-main);
    font-size: 0.95rem;
}
.mega-menu-list > li > a:hover {
    color: #1a3a2e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Mega Menu Dropdown */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #CBDED3;
    box-shadow: 0 15px 35px rgba(59,98,85,0.15), 0 5px 12px rgba(0,0,0,0.08);
    border-top: 3px solid #3B6255;
    border-bottom: 2px solid #CBDED3;
    padding: 2.5rem 0;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    transition: opacity 0.15s ease;
}
/* JS-controlled open state */
.has-mega-menu.mega-open > .mega-menu {
    opacity: 1;
    visibility: visible;
}
.mega-menu-content {
    display: flex;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
    padding: 0 2rem;
}
.mega-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mega-column li a {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}
.mega-column li a:hover {
    color: #1a3a2e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Search and Cart */
.search-bar {
    display: flex;
    background: var(--bg-light);
    border-radius: 2px;
    padding: 0.8rem 1.2rem;
    width: 100%;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1.2rem;
    width: 100%;
    color: var(--text-main);
}
.search-bar button {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.2rem;
}
.search-bar button:hover {
    color: var(--primary-dark);
}

/* Search Whisperer */
.search-whisperer {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
}
.whisperer-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.2s ease;
}
.whisperer-item:last-child {
    border-bottom: none;
}
.whisperer-item:hover {
    background: var(--bg-light);
}
.whisperer-img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    margin-right: 1rem;
    flex-shrink: 0;
    border-radius: 4px;
}
.whisperer-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.whisperer-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.whisperer-author {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.whisperer-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.2rem;
}
.whisperer-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.search-whisperer { max-height: min(70vh, 560px); }
.whisperer-item.active,
.whisperer-author-item.active,
.whisperer-all.active { background: var(--bg-light); }
.whisperer-section {
    padding: 0.45rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface);
}
.whisperer-author-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
}
.whisperer-author-item:hover { background: var(--bg-light); }
.whisperer-author-item i { color: var(--primary); width: 1rem; text-align: center; }
.whisperer-count { margin-left: auto; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.search-whisperer mark { background: none; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 2px; }
.whisperer-all {
    display: block;
    padding: 0.7rem 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--surface);
}
.whisperer-all:hover { background: var(--bg-light); }
.cart-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
}
.cart-icon i {
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

/* Promo Bar */
.promo-bar {
    background-color: var(--bg-light);
    color: var(--text-main);
    text-align: center;
    padding: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

/* ==============================
   MAIN
   ============================== */
main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 0;
}

/* ==============================
   CATEGORY PAGE LAYOUT
   ============================== */
.category-page-layout {
    display: flex;
    gap: 3rem;
}

/* Sidebar / Filters */
.sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.sidebar-block {
    margin-bottom: 2rem;
}

/* Filter Group styling exactly like Waterstones */
.filter-group-header {
    background: var(--bg-light);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.type-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0 1rem;
}

.type-filter-item {
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
}
.type-filter-item:hover, .type-filter-item.active {
    color: var(--primary);
    font-weight: 600;
}
.filter-count {
    display: none; /* Hide counts to look cleaner like Waterstones */
}

/* Redesigned Category Tree to match Waterstones filters */
.sidebar-cat-tree { max-height: none; padding: 0 1rem; }
.tree-all-link {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.tree-all-link:hover, .tree-all-link.active { color: var(--primary); font-weight: 600; }

.tree-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
}
.tree-summary::-webkit-details-marker { display: none; }
.tree-summary:hover, .tree-summary.active { color: var(--primary); font-weight: 600; }
.tree-summary a { flex: 1; pointer-events: auto; }

.tree-sub {
    margin-left: 0;
    padding-left: 1rem;
    margin-bottom: 1rem;
    margin-top: 0.25rem;
}
.tree-sub li a {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tree-sub li a:hover, .tree-sub li a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Main Catalog */
.catalog-main { flex: 1; min-width: 0; }

.catalog-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-dark);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    background: var(--surface);
    outline: none;
}

/* ==============================
   BOOK CARDS (Waterstones Style)
   ============================== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 3rem 1.5rem;
}

.book-card {
    background: transparent;
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* No border or background for the image wrapper */
.book-img-wrap {
    height: 250px;
    display: flex;
    align-items: flex-end; /* Align bottom like real books on a shelf */
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
}
.book-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Subtle shadow on the book cover itself, not a box */
    transition: transform 0.2s ease;
}
.book-card:hover .book-img-wrap img {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.no-cover {
    width: 130px;
    height: 200px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-dark);
}

/* Badges (Deluxe Exclusive style in the top left corner) */
.book-type-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    z-index: 2;
    background: #D2C49E; /* Earthy gold for badges */
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    transform: rotate(-15deg);
}
.book-type-badge.new {
    background: #8BA49A; /* Sage green for 'new' badge */
}

.book-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.book-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: calc(0.95rem * 1.3 * 2); /* Reserve exactly 2 lines of space */
}

.book-author {
    color: var(--link-blue); /* Distinct blue links */
}
.book-author:hover {
    text-decoration: underline;
}

.book-authors-wrap {
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(0.85rem * 1.2); /* Reserve exactly 1 line of space */
    width: 100%;
}

.book-availability {
    font-size: 0.75rem;
    color: #3B6255;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.book-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.book-format {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Hide star ratings and category for cleanliness, or replace with real stars */
.book-category { display: none; }

/* Add to cart / Basket */
.add-to-cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
    width: 100%;
    max-width: 160px;
}
.add-to-cart-btn:hover {
    background: var(--primary-hover);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}
.page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-dark);
    font-size: 0.85rem;
    color: var(--text-main);
    background: var(--surface);
    transition: var(--transition);
}
.page-btn:hover { border-color: var(--text-main); }
.page-btn.active { background: var(--text-main); color: white; border-color: var(--text-main); }


/* ==============================
   FOOTER
   ============================== */
.site-footer {
    background: #E2DFDA;
    border-top: 2px solid #CBDED3;
    padding: 4rem 0 2rem;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--text-muted);
}
.footer-col ul li { margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-main); }
.footer-col ul li a:hover { text-decoration: underline; }

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==============================
   PRODUCT DETAIL PAGE
   ============================== */
.breadcrumb {
    padding: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 0.7rem; }

.product-layout {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-image-wrap {
    width: 100%;
    text-align: center;
    margin-bottom: 1.5rem;
}
.main-product-img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.thumbnail-strip {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.thumbnail {
    width: 60px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
    opacity: 0.6;
    transition: var(--transition);
}
.thumbnail:hover, .thumbnail.active {
    opacity: 1;
    border-color: var(--primary);
}

.product-details {
    display: flex;
    flex-direction: column;
}
.product-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary);
    color: white;
    border-radius: 2px;
    margin-bottom: 1rem;
    align-self: flex-start;
}
.product-type-badge.product {
    background: #8BA49A;
}
.product-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.product-author {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.product-author a {
    color: var(--link-blue);
}
.product-author a:hover { text-decoration: underline; }

.product-price-block {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.product-price {
    font-size: 2rem;
    font-weight: 700;
}
.product-vat {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-availability {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3B6255;
    margin-bottom: 2rem;
}

.product-actions .btn-lg {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.product-actions .btn-lg:hover {
    background: var(--primary-hover);
}

.product-note {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.product-note h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.product-note p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-main);
}

.product-params {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.product-params h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.params-table {
    width: 100%;
    border-collapse: collapse;
}
.params-table tr {
    border-bottom: 1px solid var(--border);
}
.params-table td {
    padding: 0.75rem 0;
    font-size: 0.95rem;
}
.params-table td:first-child {
    font-weight: 600;
    color: var(--text-muted);
    width: 40%;
}
.product-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.cat-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    background: var(--bg-light);
    color: var(--text-muted);
    border-radius: 20px;
}
.cat-tag:hover {
    background: var(--border);
    color: var(--text-main);
}

/* ==============================
   CART MODAL
   ============================== */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.cart-modal {
    background: var(--surface);
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    border-radius: 4px;
}
.cart-modal-overlay.active .cart-modal {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}
.modal-close:hover {
    color: var(--text-main);
}
.modal-header h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.modal-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2rem;
}
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.modal-actions .btn {
    padding: 0.8rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    border-radius: 2px;
}
.modal-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.modal-actions .btn-outline:hover {
    border-color: var(--text-main);
}
.modal-related h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: normal;
}
.modal-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.modal-related-grid .book-card {
    border: 1px solid var(--border);
    padding: 1rem;
    background: #fff;
}
.modal-related-grid .book-img-wrap {
    height: 150px;
    margin-bottom: 0.5rem;
}
.modal-related-grid .book-title {
    font-size: 0.85rem;
}
.modal-related-grid .book-price {
    font-size: 1rem;
}
.modal-related-grid .add-to-cart-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ==============================
   CHECKOUT
   ============================== */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}
.progress-step {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--border-dark);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}
.progress-step.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}
.progress-step.completed {
    color: var(--text-main);
}
.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 4rem;
}

.checkout-section {
    margin-bottom: 3rem;
}
.checkout-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.checkout-section-header i {
    font-size: 1.5rem;
    color: var(--primary);
}

.radio-group {
    display: flex;
    flex-direction: column;
}
.radio-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.radio-option:last-child {
    border-bottom: none;
}
.radio-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.radio-left input[type="radio"] {
    accent-color: var(--primary);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}
.radio-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
}
.radio-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    margin-top: 0.2rem;
}
.radio-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.radio-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #3B6255;
    text-transform: uppercase;
}
.radio-price.cost {
    color: var(--text-main);
    text-transform: none;
}
.radio-logo {
    height: 25px;
    object-fit: contain;
}

.help-box {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 2px;
}
.help-box h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}
.help-box p {
    font-size: 0.95rem;
    font-weight: 600;
}

.summary-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 2px;
}
.summary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}
.summary-items {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.summary-item .title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}
.summary-item .qty {
    color: var(--text-muted);
    margin-right: 1rem;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.summary-row.bold {
    font-weight: 600;
    color: var(--text-main);
}
.summary-row .val {
    font-weight: 700;
}
.summary-row .val.free {
    color: #3B6255;
    text-transform: uppercase;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-dark);
}
.summary-total-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.summary-total-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}
/* ==============================
   MOBILE RESPONSIVENESS
   ============================== */
@media (max-width: 768px) {
    .logo-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .header-search-cart {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        gap: 1rem;
    }
    .search-bar {
        flex: 1;
    }
    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        background: var(--surface);
    }
    .nav-list.mobile-open {
        display: flex;
    }
    .nav-list > li {
        width: 100%;
    }
    .nav-list > li > .nav-item-wrapper {
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
    }
    .nav-list > li > a, .nav-list > li > .nav-item-wrapper > a {
        flex: 1;
        padding: 1rem;
        font-size: 0.9rem;
        border: none;
    }
    .nav-list > li:first-child > a, .nav-list > li > .nav-item-wrapper:first-child > a {
        border-left: none;
    }
    .mobile-dropdown-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 100%;
        cursor: pointer;
        color: var(--text-muted);
        transition: transform 0.2s ease;
    }
    .nav-list > li.mega-open .mobile-dropdown-icon {
        transform: rotate(180deg);
    }
    .mega-menu {
        position: static;
        width: 100%;
        display: none !important;
        opacity: 1;
        visibility: visible;
        padding: 0;
        box-shadow: none;
        border-bottom: none;
        background: var(--bg-light);
    }
    .nav-list > li.mega-open .mega-menu {
        display: block !important;
    }
    .mega-menu-content {
        max-width: 100%;
        padding: 1rem 1.5rem;
    }
    .mega-menu-list {
        column-count: 1;
    }
    .mega-menu-list > li {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }
    .mega-menu-list > li:last-child {
        border-bottom: none;
    }
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem;
        background: var(--surface);
        border: none;
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-main);
        cursor: pointer;
        text-transform: uppercase;
        border-bottom: 1px solid var(--border);
    }
    .mobile-menu-toggle i {
        font-size: 1.2rem;
    }
    .category-page-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .sidebar {
        width: 100%;
    }
    /* Hide sidebar category tree on mobile – header accordion menu provides same navigation */
    #sidebarCatBlock {
        display: none;
    }
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    .product-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-image {
        position: static;
    }
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .cart-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}
.summary-row .val {
    font-weight: 700;
}
.summary-row .val.free {
    color: #3B6255;
    text-transform: uppercase;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-dark);
}
.summary-total-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.summary-total-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}
/* ==============================
   MOBILE RESPONSIVENESS
   ============================== */
@media (max-width: 768px) {
    .logo-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .header-search-cart {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        gap: 1rem;
    }
    .search-bar {
        flex: 1;
    }
    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        background: var(--surface);
    }
    .nav-list.mobile-open {
        display: flex;
    }
    .nav-list > li {
        width: 100%;
    }
    .nav-list > li > .nav-item-wrapper {
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
    }
    .nav-list > li > a, .nav-list > li > .nav-item-wrapper > a {
        flex: 1;
        padding: 1rem;
        font-size: 0.9rem;
        border: none;
    }
    .nav-list > li:first-child > a, .nav-list > li > .nav-item-wrapper:first-child > a {
        border-left: none;
    }
    .mobile-dropdown-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 100%;
        cursor: pointer;
        color: var(--text-muted);
        transition: transform 0.2s ease;
    }
    .nav-list > li.mega-open .mobile-dropdown-icon {
        transform: rotate(180deg);
    }
    .mega-menu {
        position: static;
        width: 100%;
        display: none !important;
        opacity: 1;
        visibility: visible;
        padding: 0;
        box-shadow: none;
        border-bottom: none;
        background: var(--bg-light);
    }
    .nav-list > li.mega-open .mega-menu {
        display: block !important;
    }
    .mega-menu-content {
        max-width: 100%;
        padding: 1rem 1.5rem;
    }
    .mega-menu-list {
        column-count: 1;
    }
    .mega-menu-list > li {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }
    .mega-menu-list > li:last-child {
        border-bottom: none;
    }
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem;
        background: var(--surface);
        border: none;
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-main);
        cursor: pointer;
        text-transform: uppercase;
        border-bottom: 1px solid var(--border);
    }
    .mobile-menu-toggle i {
        font-size: 1.2rem;
    }
    .category-page-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .sidebar {
        width: 100%;
    }
    /* Hide sidebar category tree on mobile – header accordion menu provides same navigation */
    #sidebarCatBlock {
        display: none;
    }
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    .product-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-image {
        position: static;
    }
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .cart-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}
.preorder-date-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #8BA49A; color: #fff; padding: 0.25rem 0.6rem; font-size: 0.75rem; border-radius: 4px; z-index: 10; white-space: nowrap; font-weight: 600; box-shadow: 0 2px 4px rgba(0,0,0,0.2); border: 1px solid #3B6255; }
.vyprodej-badge { position: absolute; top: 6px; right: 6px; background: #dc2626; color: #fff; padding: 0.2rem 0.5rem; font-size: 0.7rem; border-radius: 4px; z-index: 10; white-space: nowrap; font-weight: 700; letter-spacing: 0.5px; box-shadow: 0 2px 4px rgba(0,0,0,0.25); }
.akce-badge { position: absolute; top: 6px; right: 6px; background: #dc2626; color: #fff; padding: 0.25rem 0.6rem; font-size: 0.75rem; border-radius: 4px; z-index: 10; white-space: nowrap; font-weight: 800; letter-spacing: 0.5px; box-shadow: 0 2px 4px rgba(0,0,0,0.25); border: 1px solid #991b1b; }
.price-original { color: var(--text-muted); text-decoration: line-through; font-size: 0.85em; font-weight: normal; margin-right: 0.3rem; }

/* ==============================
   INTERACTIVE UI FEATURES
   ============================== */

/* Expandable Text */
.anotace-wrap {
    position: relative;
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.anotace-wrap.expanded {
    max-height: 5000px;
}
.anotace-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.anotace-wrap.expanded .anotace-fade {
    opacity: 0;
}
.anotace-toggle {
    display: inline-block;
    margin-top: 0.5rem;
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}
.anotace-toggle:hover {
    text-decoration: underline;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border: 2px solid #fff;
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    background: none;
    border: none;
}
.main-product-img {
    cursor: zoom-in;
}

/* ============ USER ACCOUNT SYSTEM ============ */

/* Header user icon & dropdown */
.header-user-cart {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.user-icon {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: var(--transition);
}
.user-icon:hover {
    color: var(--primary);
}
.user-icon i {
    font-size: 1.1rem;
}
.user-menu-wrapper {
    position: relative;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: -10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
    animation: dropdownFadeIn 0.15s ease;
}
/* Invisible bridge to prevent gap between icon and dropdown */
.user-dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    right: 0;
    width: 100%;
    height: 14px;
}
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-menu-wrapper:hover .user-dropdown {
    display: block;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}
.user-dropdown a:hover {
    background: var(--bg-light);
    color: var(--primary);
}
.user-dropdown a i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}
.user-dropdown a:hover i {
    color: var(--primary);
}
.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 0;
}

/* Auth pages (login, register, forgot password) */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.auth-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 98, 85, 0.1);
}
.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.auth-btn:hover {
    background: var(--primary-hover);
}
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}
.auth-checkbox input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
}
.auth-checkbox a {
    color: var(--primary);
    text-decoration: underline;
}
.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover {
    text-decoration: underline;
}
.auth-link-small {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
}
.auth-link-small:hover {
    text-decoration: underline;
}

/* Account dashboard layout */
.account-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}
.account-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: sticky;
    top: 1rem;
}
.account-user-card {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-light) 100%);
}
.account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.4rem;
}
.account-user-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}
.account-user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.account-nav {
    padding: 0.5rem 0;
}
.account-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.account-nav-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}
.account-nav-item.active {
    background: var(--bg-light);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}
.account-nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}
.account-nav-badge {
    margin-left: auto;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.account-nav-logout {
    color: #dc2626;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
}
.account-nav-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}
.account-content {
    min-height: 400px;
}
.account-section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}
.account-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.account-empty i {
    font-size: 3rem;
    color: var(--border-dark);
    margin-bottom: 1rem;
}
.account-empty p {
    font-size: 1.1rem;
}

/* Order cards */
.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}
.order-number {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}
.order-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.75rem;
}
.order-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.status-pending {
    background: #fef3c7;
    color: #92400e;
}
.status-success {
    background: #dcfce7;
    color: #166534;
}
.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}
.order-items {
    padding: 0.75rem 1.2rem;
}
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}
.order-item-title {
    color: var(--text-main);
    flex: 1;
    margin-right: 1rem;
}
.order-item-price {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}
.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.order-total {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

/* Wishlist grid */
.wishlist-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.wishlist-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}
.wishlist-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.wishlist-item-img {
    flex-shrink: 0;
}
.wishlist-item-img img {
    width: 60px;
    height: 85px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.wishlist-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.wishlist-item-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.3;
}
.wishlist-item-title:hover {
    color: var(--primary);
}
.wishlist-item-author {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.wishlist-item-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
}
.wishlist-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.wishlist-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}
.wishlist-cart-btn:hover {
    background: var(--primary-hover);
}
.wishlist-remove-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}
.wishlist-remove-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
}
.wishlist-out-of-stock {
    font-size: 0.8rem;
    color: #dc2626;
    font-weight: 500;
}

/* Product page wishlist button */
.btn-wishlist {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.btn-wishlist:hover {
    color: #dc2626;
    border-color: #dc2626;
}
.btn-wishlist.active {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}
.btn-wishlist i {
    font-size: 1.1rem;
}

/* Responsive: account layout */
@media (max-width: 768px) {
    .account-layout {
        grid-template-columns: 1fr;
    }
    .account-sidebar {
        position: static;
    }
    .auth-row {
        grid-template-columns: 1fr;
    }
    .auth-card {
        padding: 1.5rem;
    }
    .header-user-cart {
        gap: 0.8rem;
    }
    .user-icon span {
        display: none;
    }
}

/* ============ PRODUCT REVIEWS ============ */

.reviews-section {
    padding: 2.5rem 0 3rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}
.reviews-heading {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

/* Review summary (avg + bars) */
.reviews-summary {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 2rem;
}
.reviews-avg {
    text-align: center;
    min-width: 100px;
}
.reviews-avg-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    display: block;
}
.reviews-avg-stars {
    color: #f59e0b;
    font-size: 1.1rem;
    margin: 0.4rem 0;
}
.reviews-avg-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.reviews-bars {
    flex: 1;
    max-width: 300px;
}
.reviews-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.reviews-bar-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 36px;
    text-align: right;
}
.reviews-bar-label i {
    color: #f59e0b;
    font-size: 0.7rem;
}
.reviews-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.reviews-bar-fill {
    height: 100%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.reviews-bar-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 20px;
}

/* Review form */
.review-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}
.review-toggle-btn:hover {
    background: var(--primary);
    color: white;
}
.review-form-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}
.review-form-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.7rem;
}
.review-field {
    margin-bottom: 0.6rem;
}
.review-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.review-field input[type="text"],
.review-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}
.review-field input:focus,
.review-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 98, 85, 0.1);
}

/* Star rating input */
.star-rating-input {
    display: flex;
    gap: 0.3rem;
}
.star-rating-input i {
    font-size: 1.6rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}
.star-rating-input i:hover,
.star-rating-input i.fa-solid {
    color: #f59e0b;
}
.star-rating-input i:hover {
    transform: scale(1.15);
}

/* Photo upload */
.review-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.review-photo-btn:hover {
    background: var(--primary-light);
}
.review-photo-preview {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.review-photo-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.review-photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.review-photo-login-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.review-photo-login-hint i {
    color: var(--border-dark);
}
.review-photo-login-hint a {
    color: var(--primary);
    font-weight: 600;
}

/* Review list */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.review-item {
    padding: 1.2rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.review-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.review-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.review-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.review-stars {
    color: #f59e0b;
    font-size: 0.9rem;
}
.review-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}
.review-photos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.review-photo-thumb {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.review-photo-thumb:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.review-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    .reviews-summary {
        flex-direction: column;
        text-align: center;
    }
    .reviews-bars {
        max-width: 100%;
        width: 100%;
    }
    .review-form-wrapper {
        padding: 1rem 1.2rem;
    }
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============ ADMIN PANEL ============ */

.admin-header {
    margin-bottom: 1rem;
}
.admin-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.admin-title i {
    color: var(--primary);
}
.admin-tabs {
    display: flex;
    gap: 0.3rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}
.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.admin-tab:hover {
    color: var(--primary);
}
.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* Stat cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.admin-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.admin-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}
.admin-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Tables */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table thead {
    background: var(--bg-light);
}
.admin-table th {
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.admin-table tbody tr:hover {
    background: var(--bg-light);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.admin-link:hover {
    text-decoration: underline;
}
.admin-delete-btn {
    color: #dc2626;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.admin-delete-btn:hover {
    opacity: 1;
}

/* Detail cards */
.admin-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
}
.admin-detail-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.admin-detail-card p {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Status select */
.admin-status-select {
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-main);
    min-width: 100px;
}
.admin-status-select.status-success { color: #166534; border-color: #86efac; background: #f0fdf4; }
.admin-status-select.status-pending { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.admin-status-select.status-cancelled { color: #991b1b; border-color: #fca5a5; background: #fef2f2; }

/* Review action buttons */
.admin-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.75rem;
    transition: var(--transition);
    opacity: 0.7;
}
.admin-action-btn:hover { opacity: 1; }
.admin-approve { color: #166534; background: #dcfce7; }
.admin-approve:hover { background: #bbf7d0; }
.admin-reject { color: #92400e; background: #fef3c7; }
.admin-reject:hover { background: #fde68a; }
.admin-action-btn.admin-delete-btn { color: #991b1b; background: #fee2e2; opacity: 0.7; }
.admin-action-btn.admin-delete-btn:hover { background: #fecaca; opacity: 1; }

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .admin-tabs {
        overflow-x: auto;
    }
    .admin-tab {
        white-space: nowrap;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Odkaz na Antikvariát Fryč (úvodní stránka) */
.antik-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-main);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.antik-banner:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.08); transform: translateY(-1px); }
.antik-banner-icon { font-size: 1.75rem; color: var(--primary); flex-shrink: 0; }
.antik-banner-text { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.antik-banner-text strong { font-family: var(--font-serif); font-size: 1.2rem; }
.antik-banner-text span { color: var(--text-muted); font-size: 0.95rem; }
.antik-banner-cta {
    flex-shrink: 0;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 2px;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .antik-banner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .antik-banner-icon { display: none; }
    .antik-banner-cta { white-space: normal; }
}
