/* ============================================================
   William E-Shop ebook storefront
   ============================================================ */
:root {
    --bg: #f7f0e4;
    --paper: #fffaf2;
    --surface: #fffdf8;
    --ink: #2b211a;
    --muted: #756a5e;
    --soft: #eee2d0;
    --line: #eadcc7;
    --wine: #8a1f2d;
    --wine-dark: #64131e;
    --gold: #c9952d;
    --gold-soft: #fff1c7;
    --whatsapp: #1fa855;
    --shadow: 0 10px 28px rgba(78, 46, 18, 0.11);
    --shadow-soft: 0 3px 12px rgba(78, 46, 18, 0.08);
    --radius: 8px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --site-header-height: 67px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(255, 250, 242, 0.86), rgba(247, 240, 228, 0.96)),
        var(--bg);
    color: var(--ink);
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    line-height: 1.55;
}

body.no-scroll {
    overflow: hidden;
}

body,
button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid rgba(234, 220, 199, 0.78);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.brand-text {
    display: grid;
    min-width: 0;
}

.brand-text strong {
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
    font-size: 1.02rem;
    line-height: 1.2;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-whatsapp {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--whatsapp);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(31, 168, 85, 0.2);
}

.hero-banner {
    position: relative;
    overflow: hidden;
    background: #f4e0c0;
}

.hero-banner img {
    display: block;
    width: 100%;
    height: clamp(220px, 22.4vw, 430px);
    object-fit: cover;
    object-position: center;
    opacity: 1;
}

.trust-strip {
    display: flex;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    padding: 9px 16px;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid rgba(234, 220, 199, 0.78);
    color: var(--wine-dark);
    font-size: 0.88rem;
    font-weight: 800;
    scrollbar-width: none;
    white-space: nowrap;
}

.trust-strip::-webkit-scrollbar {
    display: none;
}

.trust-strip span {
    flex: 0 0 auto;
    padding: 0 14px;
    border-right: 1px solid rgba(201, 149, 45, 0.32);
}

.trust-strip span:last-child {
    border-right: 0;
}

.section-kicker {
    margin: 0 0 6px;
    color: var(--gold-soft);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sticky-filter-dock {
    position: sticky;
    top: var(--site-header-height);
    z-index: 35;
    margin: -2px -16px 18px;
    padding: 6px 16px 7px;
    background: rgba(247, 240, 228, 0.94);
    border-bottom: 1px solid rgba(234, 220, 199, 0.72);
    backdrop-filter: blur(12px);
}

.search-band {
    padding: 0;
}

.search-shell {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) auto auto auto;
    gap: 8px;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.search-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    border: 2px solid var(--wine);
    border-radius: 50%;
    position: relative;
}

.search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    right: -6px;
    bottom: -3px;
    background: var(--wine);
    transform: rotate(45deg);
    border-radius: 2px;
}

.search-box input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.96rem;
}

.search-box input::placeholder {
    color: #9a8b7b;
}

.main-category-select {
    min-height: 48px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.main-category-select span {
    color: var(--wine);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.main-category-select select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 800;
}

.promo-strip {
    max-width: 1120px;
    min-height: 32px;
    margin: 6px auto 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid rgba(201, 149, 45, 0.42);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--wine), var(--wine-dark));
    color: #fff8e8;
    box-shadow: 0 8px 18px rgba(100, 19, 30, 0.16);
    overflow: hidden;
}

.promo-strip p {
    position: static;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

@keyframes promo-slide-left-right {
    0% {
        left: 0;
        transform: translate(-100%, -50%);
    }
    100% {
        left: 100%;
        transform: translate(0, -50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo-strip p {
        position: static;
        padding: 10px 0;
        animation: none;
        transform: none;
        white-space: normal;
    }
}

.search-clear {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0e4d4;
    color: var(--wine);
    font-size: 1.2rem;
    line-height: 1;
}

.reset-filter-btn {
    min-height: 48px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--wine);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.filter-sheet-btn {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fffaf2;
    color: var(--wine);
    border: 1px solid var(--line);
    font-size: 0.88rem;
    font-weight: 900;
    white-space: nowrap;
    display: none;
}

.top-booklist-btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--wine);
    color: #fff;
    box-shadow: 0 9px 18px rgba(138, 31, 45, 0.24);
    font-weight: 900;
    white-space: nowrap;
}

.top-booklist-btn span {
    line-height: 1;
}

.top-booklist-btn strong {
    font-size: 0.9rem;
}

.site-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 16px 42px;
    display: flex;
    flex-direction: column;
}

.homepage-weekly {
    order: 1;
}

.homepage-curated {
    order: 2;
}

.catalog-tools {
    order: 0;
}

.all-books-section {
    order: 4;
}

.popular-categories-section,
.explore-section {
    display: none;
}

.member-offer-ticket {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 30px;
    margin: -1px 0;
    padding: 5px 16px;
    border: 0;
    border-right: 1px dashed rgba(255, 248, 232, 0.55);
    background: #fff8e8;
    color: var(--wine);
    font: inherit;
    cursor: pointer;
}

.member-offer-ticket::before,
.member-offer-ticket::after {
    content: '';
    position: absolute;
    right: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--wine);
}

.member-offer-ticket::before { top: -6px; }
.member-offer-ticket::after { bottom: -6px; }

.member-offer-ticket strong { font-weight: 950; }

.member-offer-ticket span {
    font-size: 0.76rem;
    font-weight: 800;
}

.member-offer-ticket.is-urgent span { color: #a51f1f; }

.member-offer-ticket:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

body.search-active .main-category-select,
body.search-active .filter-sheet-btn,
body.search-active .subcategory-panel,
body.search-active .popular-categories-section,
body.search-active .homepage-weekly,
body.search-active .homepage-curated,
body.search-active .explore-section,
body.category-active .main-category-select,
body.category-active .filter-sheet-btn,
body.category-active .popular-categories-section,
body.category-active .homepage-weekly,
body.category-active .homepage-curated,
body.category-active .explore-section {
    display: none !important;
}

body.search-active .all-books-section,
body.category-active .all-books-section {
    order: 1;
}

.section-block,
.subcategory-panel {
    margin: 0 0 36px;
}

.section-heading,
.subcategory-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-kicker {
    color: var(--gold);
}

.section-heading h2,
.subcategory-heading h2 {
    margin: 0;
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
    font-size: 1.42rem;
    line-height: 1.2;
}

.section-note,
.subcategory-heading span {
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.result-heading-actions,
.result-navigation {
    display: flex;
    align-items: center;
}

.result-heading-actions {
    justify-content: flex-end;
    gap: 12px;
}

.result-navigation {
    gap: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.result-navigation a,
.result-navigation button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--wine);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.result-navigation a:focus-visible,
.result-navigation button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 2px;
}

.subcategory-panel .subcategory-heading {
    flex: 0 0 auto;
    align-items: center;
    margin: 0;
    gap: 8px;
}

.subcategory-panel .section-kicker {
    display: none;
}

.subcategory-panel .subcategory-heading h2 {
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    font-size: 0.92rem;
    font-weight: 900;
    white-space: nowrap;
}

.subcategory-panel .subcategory-heading span {
    font-size: 0.82rem;
}

.popular-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.category-card {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 126px;
    padding: 13px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fffdf9, #fff8ef);
    color: var(--ink);
    text-align: center;
    box-shadow: 0 10px 22px rgba(97, 53, 20, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.category-card:hover,
.category-card.active {
    border-color: rgba(138, 31, 45, 0.34);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.category-card.active {
    background: linear-gradient(180deg, #8a1f2d, #67131f);
    color: #fff;
}

.category-card::after {
    content: none;
}

.category-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a1f2d;
}

.category-icon svg {
    width: 32px;
    height: 32px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-card.active .category-icon {
    color: #ffe3a8;
}

.category-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: #7a5211;
    font-size: 0.74rem;
    font-weight: 800;
}

.category-card.active .category-rank {
    background: rgba(255, 241, 199, 0.18);
    color: #ffe19a;
}

.category-card strong {
    display: block;
    margin-top: 0;
    font-size: 0.95rem;
    line-height: 1.18;
}

.subcategory-panel {
    max-width: 1120px;
    min-height: 38px;
    margin: 6px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subcategory-chips {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
}

.subcategory-chips::-webkit-scrollbar {
    display: none;
}

.sub-chip {
    flex: 0 0 auto;
    min-height: 32px;
    max-width: min(260px, 70vw);
    padding: 0 12px;
    border: 1px solid #e2cfb5;
    border-radius: 999px;
    background: #fffaf2;
    color: #4b3b2d;
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-chip span {
    color: var(--gold);
    font-weight: 800;
}

.sub-chip.active {
    background: var(--wine);
    border-color: var(--wine);
    color: #fff;
}

.sub-chip.active span {
    color: #ffe2a1;
}

.carousel {
    position: relative;
    min-width: 0;
    max-width: 100%;
    padding: 0 44px;
}

.book-rail {
    display: grid;
    grid-auto-flow: column;
    gap: 14px;
    grid-auto-columns: calc((100% - 14px) / 2);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 2px 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.book-rail::-webkit-scrollbar {
    display: none;
}

.book-card-rail {
    scroll-snap-align: start;
}

.carousel-btn {
    position: absolute;
    top: 39%;
    z-index: 3;
    width: 38px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(234, 220, 199, 0.95);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.96);
    color: var(--wine);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(78, 46, 18, 0.16);
    transform: translateY(-50%);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.carousel-btn:hover {
    background: #fff7e8;
    transform: translateY(-50%) scale(1.04);
}

.carousel-btn:disabled {
    opacity: 0.28;
    cursor: default;
    pointer-events: none;
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

.carousel.is-static .carousel-btn {
    display: none;
}

.curated-stack {
    display: grid;
    gap: 30px;
}

.curated-row-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.curated-row-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.05rem;
}

.curated-row-heading span {
    color: var(--muted);
    font-size: 0.86rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.all-books-section {
    scroll-margin-top: 168px;
}

.book-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 8px 20px rgba(60, 20, 10, 0.06);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    scroll-snap-align: start;
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: #c79a57;
    box-shadow: 0 18px 34px rgba(60, 20, 10, 0.16);
}

.book-cover {
    height: 230px;
    margin: 10px 10px 0;
    border-radius: 6px;
    background: linear-gradient(160deg, #9b2333, #dbb35e);
    overflow: hidden;
    position: relative;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.22s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.025);
}

.book-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0;
    padding: 12px 13px 14px;
}

.book-category {
    align-self: flex-start;
    max-width: 100%;
    display: inline-block;
    padding: 5px 8px;
    border-radius: 6px;
    background: #f6e6d5;
    color: var(--wine);
    font-size: 0.68rem;
    font-weight: 900;
    margin-bottom: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-info h3 {
    height: 38px;
    min-height: 0;
    margin: 0;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.35;
}

.book-info p {
    height: 34px;
    min-height: 0;
    margin: 6px 0 0;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.4;
}

.book-promo-note {
    height: auto !important;
    margin: 8px 0 0 !important;
    color: var(--wine) !important;
    font-size: 0.74rem !important;
    font-weight: 800;
    -webkit-line-clamp: 1 !important;
}

.book-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.book-meta span {
    min-width: 0;
    color: #8f806e;
    font-size: 0.76rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-meta strong {
    flex: 0 0 auto;
    color: var(--wine);
    font-size: 0.95rem;
    font-weight: 900;
}

.book-actions {
    margin-top: 10px;
}

.quick-add-btn {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid transparent;
    background: var(--wine);
    color: #fff;
    box-shadow: 0 7px 16px rgba(143, 29, 44, 0.18);
    transition: transform 0.16s ease, background 0.16s ease;
}

.quick-add-btn span {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.05rem;
    line-height: 1;
}

.quick-add-btn strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-add-btn.is-added {
    border-color: rgba(201, 149, 45, 0.68);
    background: var(--gold-soft);
    color: var(--wine-dark);
    box-shadow: none;
}

.quick-add-btn.is-added span {
    background: rgba(138, 31, 45, 0.12);
}

.quick-add-btn.btn-clicked {
    transform: scale(0.97);
    background: var(--wine-dark);
}

.quick-add-btn:hover {
    background: var(--wine-dark);
}

.quick-add-btn.is-added:hover {
    background: #f8dfa0;
}

.books-grid .book-cover {
    height: 270px;
}

.books-grid .book-info h3 {
    font-size: 0.94rem;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(28, 18, 14, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.sheet-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1eadf;
    color: #6b5a49;
    font-size: 1.45rem;
    line-height: 1;
}

.detail-sheet,
.cart-sheet,
.category-sheet {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 80;
    width: min(560px, calc(100vw - 24px));
    max-height: min(88vh, 760px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(37, 19, 9, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -46%) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.detail-sheet.open,
.cart-sheet.open,
.category-sheet.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.category-sheet {
    width: min(640px, calc(100vw - 24px));
}

.detail-sheet {
    width: min(760px, calc(100vw - 24px));
}

.filter-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 80;
    width: min(640px, 100vw);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 60px rgba(37, 19, 9, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 102%);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.filter-sheet.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.category-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 10px;
}

.category-sheet-header h2 {
    margin: 0;
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
    font-size: 1.22rem;
}

.category-sheet-body {
    overflow: auto;
    padding: 0 20px 20px;
}

.category-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.category-sheet-back {
    margin: 0 0 12px;
    border: 0;
    background: transparent;
    color: var(--wine);
    font-size: 0.9rem;
    font-weight: 700;
}

.category-sheet-chip {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #e2cfb5;
    border-radius: 999px;
    background: #fffaf2;
    color: #4b3b2d;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.category-sheet-chip:hover {
    border-color: rgba(138, 31, 45, 0.42);
    color: var(--wine);
}

.category-sheet-empty {
    margin: 6px 0 2px;
    padding: 18px;
    border-radius: var(--radius);
    background: #fff8ec;
    color: var(--muted);
    text-align: center;
}

.category-sheet-footer {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
    gap: 12px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
}

.category-sheet-cancel,
.category-sheet-share,
.category-sheet-apply {
    min-height: 48px;
    border-radius: 999px;
    font-weight: 900;
}

.category-sheet-cancel {
    background: #fffaf2;
    color: var(--wine);
    border: 1px solid var(--line);
}

.category-share-footer {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.6fr);
}

.category-sheet-share {
    background: #fffaf2;
    color: var(--wine);
    border: 1px solid var(--wine);
}

.category-sheet-apply {
    background: var(--wine);
    color: #fff;
}

.filter-group {
    padding-top: 12px;
}

.filter-group + .filter-group {
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.filter-group h3 {
    margin: 0 0 10px;
    color: var(--wine-dark);
    font-size: 0.96rem;
}

.filter-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.filter-chip {
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid #e2cfb5;
    border-radius: var(--radius);
    background: #fffaf2;
    color: #4b3b2d;
    text-align: left;
}

.filter-chip strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}

.filter-check {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid #d8c3a5;
    border-radius: 4px;
    background: #fff;
}

.filter-chip.active {
    border-color: rgba(138, 31, 45, 0.5);
    background: #fff0e8;
    color: var(--wine);
}

.filter-chip.active .filter-check {
    border-color: var(--wine);
    background:
        linear-gradient(135deg, transparent 58%, #fff 58%),
        var(--wine);
}

.filter-empty {
    margin: 0;
    padding: 14px;
    border-radius: var(--radius);
    background: #fff8ec;
    color: var(--muted);
    font-size: 0.88rem;
}

.detail-close {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 2;
}

.detail-body {
    overflow: auto;
    padding: 24px 28px 18px;
    display: grid;
    grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
    gap: 18px 22px;
}

.detail-cover {
    width: 100%;
    max-width: 150px;
    margin: 0;
    padding: 0;
    position: relative;
    align-self: start;
    border-radius: 10px;
    background: transparent;
    box-shadow: 0 12px 28px rgba(37, 19, 9, 0.18);
    overflow: hidden;
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.detail-cover span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(69, 48, 39, 0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.detail-info h2 {
    margin: 12px 0 8px;
    color: var(--ink);
    font-size: 1.16rem;
    line-height: 1.38;
}

.detail-price {
    color: var(--wine);
    font-size: 1.45rem;
    font-weight: 900;
}

.detail-info p {
    margin: 14px 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.detail-info {
    min-width: 0;
    padding-right: 18px;
}

.detail-meta {
    padding: 11px 13px;
    border-radius: var(--radius);
    background: #f4efe7;
    color: #817363;
    font-size: 0.88rem;
}

.manual-share-panel {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(201, 149, 45, 0.42);
    border-radius: var(--radius);
    background: #fff8ec;
}

.manual-share-panel h3 {
    margin: 0;
    color: var(--wine-dark);
    font-size: 1rem;
}

.manual-share-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.manual-share-panel textarea {
    width: 100%;
    min-height: 210px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #e2cfb5;
    border-radius: 8px;
    background: #fffdf8;
    color: var(--ink);
    font: inherit;
    line-height: 1.55;
}

.detail-rich {
    grid-column: 1 / -1;
    display: grid;
    gap: 16px;
    padding-top: 4px;
}

.detail-loading {
    padding: 14px 16px;
    border-radius: var(--radius);
    background: #fff8ec;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.detail-section {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.detail-section h3 {
    margin: 0 0 10px;
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
    font-size: 1rem;
}

.detail-long-desc {
    margin: 0;
    color: #5f5043;
    font-size: 0.94rem;
    line-height: 1.75;
}

.detail-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #5f5043;
    font-size: 0.92rem;
    line-height: 1.7;
}

.detail-list li + li {
    margin-top: 5px;
}

.detail-toc {
    display: grid;
    gap: 10px;
}

.detail-toc-item {
    padding: 12px 14px;
    border: 1px solid #eadcc8;
    border-radius: 8px;
    background: #fffaf2;
}

.detail-toc-item strong {
    display: block;
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.45;
}

.detail-toc-item p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.detail-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 18px 18px;
    border-top: 1px solid var(--line);
}

.detail-qty,
.cart-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffaf2;
    font-weight: 800;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0eadf;
    color: var(--ink);
    font-size: 1.15rem;
}

.btn-add-detail {
    min-height: 50px;
    border-radius: 999px;
    font-weight: 900;
    background: var(--wine);
    color: #fff;
}

.btn-share-detail {
    min-height: 50px;
    border: 1px solid rgba(138, 31, 45, 0.24);
    border-radius: 999px;
    background: #fff8ec;
    color: var(--wine-dark);
    font-weight: 900;
}

.btn-share-detail:disabled {
    cursor: wait;
    opacity: 0.78;
}

.btn-add-detail.is-added {
    border: 1px solid rgba(201, 149, 45, 0.68);
    background: var(--gold-soft);
    color: var(--wine-dark);
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(19, 12, 8, 0.78);
}

.image-modal.show {
    display: flex;
}

.image-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
}

.image-modal-img {
    max-height: 82vh;
    width: auto;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.image-modal-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    color: #fff;
    text-align: center;
    font-weight: 700;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(234, 220, 199, 0.72);
    background: #fffdf8;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.18rem;
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
}

.booklist-content {
    flex: 1;
    overflow: auto;
    display: grid;
    gap: 14px;
    padding: 14px 20px 20px;
    background: #fffaf2;
}

.booklist-promo {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(201, 149, 45, 0.42);
    border-radius: var(--radius);
    background: #fff6df;
    color: var(--wine-dark);
    box-shadow: 0 6px 16px rgba(121, 78, 21, 0.06);
}

.booklist-promo.is-max {
    background: var(--wine);
    color: #fff8e8;
}

.booklist-promo h3,
.booklist-section h3,
.customer-info h3,
.cart-summary-panel h3,
.trust-card h3 {
    margin: 0;
    color: var(--wine-dark);
    font-size: 0.98rem;
    font-weight: 900;
}

.booklist-promo.is-max h3 {
    color: #fff8e8;
}

.booklist-promo > strong {
    color: var(--wine);
    font-size: 0.9rem;
    line-height: 1.35;
}

.booklist-promo.is-max > strong {
    color: #fff;
}

.booklist-section,
.customer-info,
.cart-summary-panel,
.trust-card {
    border: 1px solid rgba(234, 220, 199, 0.92);
    border-radius: var(--radius);
    background: #fffdf8;
    box-shadow: 0 5px 14px rgba(78, 46, 18, 0.05);
}

.booklist-section,
.customer-info,
.cart-summary-panel,
.trust-card {
    padding: 14px;
}

.booklist-section {
    display: grid;
    gap: 10px;
}

.cart-items {
    overflow: visible;
    padding: 0;
}

.cart-empty {
    padding: 22px 12px;
    color: var(--muted);
    text-align: center;
}

.cart-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cart-item-img {
    width: 58px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    background: #eee0ce;
}

.cart-item-title {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.36;
}

.cart-item-price-unit {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.cart-item-qty {
    color: #7e705f;
    font-size: 0.82rem;
    font-weight: 800;
}

.cart-qty-control {
    gap: 8px;
    padding: 3px;
}

.cart-qty-control .qty-btn {
    width: 28px;
    height: 28px;
}

.cart-item-total-price {
    color: var(--wine);
    white-space: nowrap;
}

.remove-btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    color: #9a8978;
    font-size: 1.4rem;
}

.customer-info {
    display: grid;
    gap: 12px;
    border-color: rgba(201, 149, 45, 0.38);
    background: #fff8ec;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-field {
    display: grid;
    gap: 6px;
}

.form-field span {
    color: var(--wine-dark);
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1.35;
}

.form-control {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    background: #fffdf8;
    color: var(--ink);
    font-size: 0.92rem;
    outline: none;
}

.contact-helper,
.checkout-note {
    margin: 0;
    color: #7e705f;
    font-size: 0.83rem;
    line-height: 1.55;
}

.contact-helper {
    display: grid;
    gap: 4px;
    padding-top: 2px;
}

.contact-helper p {
    margin: 0;
}

.form-control:focus {
    border-color: var(--gold);
}

.cart-footer {
    padding: 0;
    border-top: 0;
}

.cart-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.summary-row {
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border: 1px solid rgba(234, 220, 199, 0.88);
    border-radius: var(--radius);
    background: #fffaf2;
    margin-bottom: 0;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
}

.summary-row span {
    color: #6f6254;
}

.summary-row strong {
    color: var(--wine);
    font-size: 0.96rem;
}

.summary-payable {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding: 12px;
    border-color: rgba(138, 31, 45, 0.2);
    background: #fff5ef;
    font-size: 1rem;
    font-weight: 900;
}

.summary-payable strong {
    color: var(--wine);
    font-size: 1.35rem;
}

@media (max-width: 420px) {
    .cart-summary {
        grid-template-columns: minmax(0, 1fr);
    }
}

.trust-card {
    display: grid;
    gap: 10px;
    border-color: rgba(201, 149, 45, 0.44);
    background: #fff7df;
}

.trust-card ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    color: #4f4032;
    font-size: 0.88rem;
    font-weight: 800;
    list-style: none;
}

.cart-actions {
    margin-top: 0;
}

.cart-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.checkout-btn {
    min-height: 48px;
    border-radius: 999px;
    font-weight: 900;
}

.checkout-btn {
    background: var(--whatsapp);
    color: #fff;
}

.checkout-note {
    margin-top: 10px;
    text-align: center;
}

.checkout-bar {
    position: fixed;
    right: 18px;
    bottom: calc(18px + var(--safe-bottom));
    z-index: 120;
    width: auto;
    max-width: calc(100vw - 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(201, 149, 45, 0.38);
    border-radius: 999px;
    background: var(--wine);
    color: #fff;
    box-shadow: 0 14px 30px rgba(138, 31, 45, 0.36);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: none;
}

.checkout-bar:not(.show) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.checkout-bar.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

body.filter-open .checkout-bar {
    display: none;
}

body:has(#filter-sheet.open) .checkout-bar {
    display: none;
}

body.cart-open .checkout-bar {
    display: none;
}

.member-offer-reminder {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(138, 31, 45, 0.24);
}

.member-offer-label {
    padding: 5px 7px;
    border-radius: 4px;
    background: var(--wine);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
}

.member-offer-reminder div { display: grid; gap: 3px; }

.member-offer-reminder strong {
    color: var(--wine-dark);
    font-size: 0.94rem;
}

.member-offer-reminder small {
    color: #6f6254;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.4;
}

.member-offer-reminder.is-urgent small { color: #a51f1f; }

.volume-promo-progress {
    color: var(--wine);
    font-size: 0.86rem;
}

body:has(#cart.open) .checkout-bar {
    display: none;
}

body.detail-open .checkout-bar {
    display: none;
}

body:has(#detail-sheet.open) .checkout-bar {
    display: none;
}

.checkout-bar-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    white-space: nowrap;
}

.checkout-bar-info strong {
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff8e8;
    color: var(--wine);
    font-size: 0.86rem;
}

.cart-toggle-btn {
    position: fixed;
    right: 18px;
    bottom: calc(18px + var(--safe-bottom));
    z-index: 55;
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--wine);
    color: #fff;
    box-shadow: 0 12px 24px rgba(138, 31, 45, 0.3);
}

.cart-count {
    position: absolute;
    right: -2px;
    top: -4px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.active-filter-line {
    margin: -4px 0 16px;
    padding: 10px 12px;
    border: 1px solid #ead4cf;
    border-radius: var(--radius);
    background: #fff5f3;
    color: var(--wine);
    font-size: 0.9rem;
    font-weight: 700;
}

.empty-state {
    margin: 18px 0 4px;
    padding: 34px 18px;
    border: 1px dashed #d8b9a7;
    border-radius: var(--radius);
    background: rgba(255, 253, 248, 0.68);
    text-align: center;
}

.empty-state p {
    margin: 0 0 16px;
    color: var(--muted);
}

.empty-state a,
.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--wine);
    color: #fff;
    font-weight: 800;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 22px 0 4px;
}

.loading-panel {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(247, 240, 228, 0.88);
    backdrop-filter: blur(9px);
    transition: opacity 0.22s ease;
}

.loading-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-card {
    width: min(320px, 100%);
    display: grid;
    gap: 5px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-align: center;
    box-shadow: var(--shadow);
}

.loading-card strong {
    color: var(--wine-dark);
    font-family: "Noto Serif SC", serif;
    font-size: 1.16rem;
}

.loading-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.error-card {
    border: 1px solid #e3ada7;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(22px + var(--safe-bottom));
    z-index: 90;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--wine-dark);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow);
    pointer-events: none;
    transform: translate(-50%, 12px);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body.has-checkout-bar .toast {
    bottom: calc(92px + var(--safe-bottom));
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.site-footer {
    padding: 30px 16px calc(34px + var(--safe-bottom));
    border-top: 1px solid rgba(234, 220, 199, 0.78);
    background: #fff8ed;
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.footer-section h2 {
    margin: 0 0 8px;
    color: var(--wine-dark);
    font-size: 0.94rem;
}

.footer-section p,
.footer-section ol {
    margin: 0;
}

.footer-section p + p {
    margin-top: 5px;
}

.footer-section ol {
    padding-left: 18px;
}

.footer-section li + li {
    margin-top: 3px;
}

.site-footer a {
    color: var(--wine);
    font-weight: 700;
}

noscript {
    display: block;
    margin: 20px;
    padding: 14px;
    border: 1px solid #e3ada7;
    border-radius: var(--radius);
    background: #fff6f4;
    color: var(--wine);
}

@media (max-width: 720px) {
    body {
        padding-bottom: calc(92px + var(--safe-bottom));
    }

    .checkout-bar {
        left: 18px;
        right: 18px;
        bottom: calc(18px + var(--safe-bottom));
        width: auto;
        max-width: none;
        min-height: 62px;
        justify-content: center;
        padding: 10px 16px;
        box-shadow: 0 16px 34px rgba(100, 19, 30, 0.36);
    }

    .checkout-bar-info {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
    }
}

@media (max-width: 560px) {
    body {
        padding-bottom: calc(92px + var(--safe-bottom));
    }

    .site-header {
        min-height: var(--site-header-height);
        padding: 10px 12px;
    }

    .header-whatsapp {
        min-height: 34px;
        padding: 0 11px;
        font-size: 0.8rem;
    }

    .hero-banner {
        display: none;
    }

    .trust-strip {
        justify-content: flex-start;
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .trust-strip span {
        padding: 0 10px;
    }

    .hero-banner img {
        height: clamp(120px, 36vw, 150px);
        object-position: 24% center;
    }

    .sticky-filter-dock {
        position: sticky;
        top: var(--site-header-height);
        z-index: 35;
        margin: 0 -16px 12px;
        padding: 8px 12px;
    }

    .catalog-tools {
        order: 0;
    }

    .homepage-weekly {
        order: 1;
    }

    .homepage-curated {
        order: 2;
    }

    .all-books-section {
        order: 3;
    }

    .search-box {
        min-height: 46px;
        padding: 0 12px;
    }

    .search-box input {
        padding: 10px 0;
    }

    .search-shell {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 7px;
    }

    .search-box {
        grid-column: 1 / -1;
    }

    .main-category-select {
        min-height: 42px;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0 12px;
    }

    .main-category-select span {
        display: none;
    }

    .filter-sheet-btn {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-booklist-btn {
        min-height: 42px;
        padding: 0 10px;
        gap: 5px;
    }

    .top-booklist-btn strong {
        font-size: 0.82rem;
    }

    .reset-filter-btn {
        display: none;
    }

    .promo-strip {
        min-height: 30px;
        margin-top: 6px;
        padding: 0;
    }

    .promo-strip p {
        flex: 1;
        padding-right: 8px;
        font-size: 0.78rem;
    }

    .member-offer-ticket {
        flex: 0 0 auto;
        max-width: 66%;
        padding: 5px 10px;
    }

    .member-offer-ticket span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .subcategory-panel {
        min-height: 36px;
        margin-top: 6px;
        gap: 0;
    }

    .subcategory-panel .subcategory-heading {
        display: none;
    }

    .subcategory-chips {
        width: 100%;
        gap: 7px;
        padding: 0;
    }

    .sub-chip {
        min-height: 34px;
        font-size: 0.82rem;
    }

    .popular-categories-section {
        display: none;
    }

    .category-sheet-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-sheet-footer {
        grid-template-columns: minmax(0, 1fr);
    }

    .all-books-section {
        scroll-margin-top: 188px;
    }

    .section-heading,
    .subcategory-heading {
        align-items: start;
        flex-direction: column;
        gap: 5px;
    }

    .result-heading-actions {
        width: 100%;
        justify-content: space-between;
    }

    .carousel {
        padding: 0 14px;
    }

    .carousel-btn {
        width: 32px;
        height: 44px;
        top: 42%;
        background: rgba(255, 253, 248, 0.9);
        font-size: 1.75rem;
    }

    .carousel-btn-prev {
        left: 0;
    }

    .carousel-btn-next {
        right: 0;
    }

    .book-promo-note {
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: initial;
        line-height: 1.35;
    }

    .book-cover,
    .books-grid .book-cover {
        height: 190px;
    }

    .detail-body {
        display: block;
        padding: 24px 28px 18px;
    }

    .detail-cover {
        width: min(150px, 42vw);
        margin: 0 auto 14px;
    }

    .detail-info {
        padding-right: 0;
    }

    .detail-footer {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-rich {
        margin-top: 16px;
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

@media (min-width: 720px) {
    .site-header {
        padding: 14px 28px;
    }

    .search-shell {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .main-category-select {
        display: none;
    }

    .popular-categories-section {
        display: block;
    }

    .popular-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .books-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .book-rail {
        grid-auto-columns: calc((100% - 28px) / 3);
    }
}

@media (min-width: 1040px) {
    .hero-banner img {
        height: clamp(300px, 22.4vw, 430px);
    }

    .popular-category-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .books-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }

    .book-rail {
        grid-auto-columns: calc((100% - 42px) / 4);
    }
}
