/*
Theme Name: Erchuud Storefront
Description: Mongolian WooCommerce storefront for Эрчүүдийн дэлгүүр.
Version: 2.6.0
Requires PHP: 8.1
Text Domain: erchuud-storefront
*/

:root {
    --red: #b00920;
    --deep-red: #830b25;
    --ink: #241b20;
    --muted: #66555e;
    --line: #ebdfe3;
    --page: #fbf8f8;
    --pink: #faedf0;
    --white: #fff;
    --radius: 14px;
    --wrap: 1280px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 18px; }
body { margin: 0; color: var(--ink); background: var(--page); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; height: auto; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #d85473; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { line-height: 1.14; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 4.2vw, 2.2rem); }
.wrap { width: min(calc(100% - 24px), var(--wrap)); margin-inline: auto; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: absolute; z-index: 1000; inset: 7px auto auto 7px; padding: 10px; background: white; }
.staging-strip { background: #2e2027; color: white; text-align: center; padding: 5px 10px; font-size: .74rem; }
.topline { background: var(--red); color: white; font-size: .79rem; }
.topline .wrap { display: flex; justify-content: space-between; gap: 12px; padding-block: 7px; }
.topline span + span { display: none; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; padding-block: 10px; }
.store-wordmark { display: flex; gap: 6px; align-items: center; font-size: clamp(.96rem, 4vw, 1.4rem); letter-spacing: -.055em; white-space: nowrap; }
.store-wordmark b:last-child { color: var(--red); }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 32px; background: var(--red); color: white; font: 750 1.55rem/1 "Segoe UI Symbol", sans-serif; }
.store-search { display: flex; gap: 6px; align-items: center; grid-column: 1/-1; grid-row: 2; min-width: 0; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.store-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 10px; }
.store-search button, .cart-link, .assistant-toggle { background: var(--red); color: white; border: 0; border-radius: 9px; font-weight: 750; padding: 8px 12px; min-height: 42px; }
.cart-link:hover, .assistant-toggle:hover { color: white; background: var(--deep-red); }
.head-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-weight: 700; }
.head-actions .account-link { display: none; }
.erchuud-cart-count { display: inline-grid; place-items: center; min-width: 21px; padding-inline: 4px; min-height: 21px; border-radius: 10px; background: var(--pink); color: var(--red); font-size: .76rem; }
.navline { display: none; }
.store-main { min-height: 52vh; padding-block: 16px 36px; }
.promo { margin: 0 0 19px; }
.promo-viewport { position: relative; border-radius: 15px; overflow: hidden; touch-action: pan-y; }
.promo-slide { display: grid; grid-template-columns: 1.12fr .88fr; position: relative; align-items: center; min-height: clamp(210px, 37vw, 430px); color: white; background: linear-gradient(115deg, #390314, #990d2b 55%, #bb2448); }
.promo-slide:hover { color: white; }
.promo-slide.berry { background: linear-gradient(110deg, #2c0a1c, #8e3256); }
.promo-slide.ink { background: linear-gradient(110deg, #281521, #68283f); }
.promo-copy { position: relative; z-index: 1; padding: 24px 0 24px clamp(37px, 6vw, 84px); }
.promo-copy span, .promo-copy small { display: block; font-size: clamp(.71rem, 2vw, 1rem); font-weight: 700; }
.promo-copy strong { display: block; margin-block: 7px 10px; font-size: clamp(1.44rem, 5.8vw, 4.6rem); letter-spacing: -.043em; line-height: 1.02; }
.promo-copy small { width: fit-content; padding: 6px 10px; color: #530b20; border-radius: 6px; background: white; }
.promo-slide img { width: 88%; height: auto; max-height: 365px; max-width: 480px; margin-right: 9px; justify-self: center; aspect-ratio: 1; object-fit: contain; }
.promo-prev, .promo-next { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 45px; padding: 0; border: 0; border-radius: 8px; color: white; background: #28111ab8; font-size: 1.8rem; line-height: 1; }
.promo-prev { left: 2px; }
.promo-next { right: 2px; }
.promo-tools { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding-top: 7px; }
.promo-dots { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.promo-dots button { width: clamp(17px, 5.5vw, 34px); height: 33px; border: 0; background: transparent; padding: 0; }
.promo-dots button::before { content: ''; display: block; height: 4px; margin: 0 2px; border-radius: 9px; background: #ddc8d0; }
.promo-dots button[aria-current=true]::before { background: var(--red); }
.quiet-button { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--red); min-height: 38px; padding: 5px 9px; font-size: .85rem; font-weight: 700; }
.store-section { margin-block: 0 27px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 0 11px; }
.section-heading h2 { margin: 0; }
.section-heading a { flex-shrink: 0; color: var(--red); font-size: .86rem; font-weight: 750; }
.department-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; }
.department-grid details { border: 1px solid #efdde2; border-radius: 12px; background: white; min-width: 0; }
.department-grid summary { display: flex; align-items: center; gap: 5px; min-height: 56px; padding: 8px; cursor: pointer; list-style: none; border-radius: 11px; background: linear-gradient(125deg, #fff, #faedf0); font-weight: 750; font-size: clamp(.85rem, 3.65vw, 1.1rem); line-height: 1.18; }
.department-grid summary::-webkit-details-marker { display: none; }
.department-grid details[open] summary { background: #f8dde5; }
.department-icon, .department-arrow { color: var(--red); font-family: "Segoe UI Symbol", sans-serif; font-size: 1.25rem; flex: 0 0 auto; }
.department-arrow { margin-left: auto; }
.department-grid ul { list-style: none; margin: 0; padding: 3px 8px 4px; }
.department-grid li + li { border-top: 1px solid var(--line); }
.department-grid li a { display: flex; align-items: center; min-height: 42px; overflow-wrap: anywhere; font-size: .88rem; }
.legacy-slider { border-radius: var(--radius); background: white; border: 1px solid var(--line); overflow: hidden; text-align: right; padding-bottom: 6px; }
.legacy-slider iframe { display: block; width: 100%; height: clamp(200px, 42vw, 500px); border: 0; }
.legacy-slider button { margin-right: 8px; }
.motion-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.motion-products a { background: white; padding: 6px; border: 1px solid var(--line); border-radius: 10px; font-size: .86rem; font-weight: 700; }
.motion-products img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.site-footer { padding: 24px 0 86px; background: #251c21; color: white; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.site-footer a:hover { color: #ffd9e3; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; width: 100%; padding-bottom: 14px; border-bottom: 1px solid #674f5a; }
.bottom-nav { position: fixed; inset: auto 0 0; z-index: 6; display: flex; padding: 4px 0 max(env(safe-area-inset-bottom), 3px); border-top: 1px solid var(--line); background: white; }
.bottom-nav a, .bottom-nav button { flex: 1; display: grid; place-items: center; padding: 2px 0; min-height: 44px; font-size: .73rem; font-weight: 750; border: 0; background: white; color: var(--ink); }
.content-page { overflow-wrap: anywhere; }
.content-page article { background: white; border: 1px solid var(--line); padding: clamp(12px, 4vw, 28px); border-radius: var(--radius); }
.story-list { display: grid; gap: 10px; }

.woocommerce ul.products, .woocommerce-page ul.products { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin: 0 0 22px; }
.woocommerce ul.products::before, .woocommerce ul.products::after, .woocommerce-page ul.products::before, .woocommerce-page ul.products::after { display: none; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { float: none; width: auto !important; min-width: 0; margin: 0 !important; position: relative; display: flex; flex-direction: column; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.woocommerce ul.products li.product a img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; margin: 0 0 6px; background: #f8f5f6; }
.woocommerce ul.products li.product a.woocommerce-loop-product__link { display: flex; flex-direction: column; flex: 1; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: clamp(.9rem, 3.6vw, 1.14rem); color: var(--ink); line-height: 1.22; padding-block: 4px; }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--red); font-size: clamp(.98rem, 4vw, 1.3rem); font-weight: 850; }
.woocommerce .price del { color: var(--muted); font-size: .82em; }
.woocommerce .price ins { text-decoration: none; }
.stock-label { color: #236346; display: inline-flex; margin-bottom: 4px; font-size: .77rem; font-weight: 650; }
.stock-label.out { color: #654955; }
.product-badges { display: flex; gap: 3px; flex-wrap: wrap; margin-block: 2px; }
.product-badges span { padding: 2px 5px; background: var(--pink); color: var(--red); border-radius: 4px; font-size: .68rem; font-weight: 750; }
.woocommerce span.onsale { background: var(--red); padding: 3px 7px; min-height: 0; min-width: 0; line-height: 1.4; border-radius: 6px; }
.woocommerce ul.products li.product .onsale { right: auto; top: 11px; left: 11px; margin: 0; }
.save-product { position: absolute; z-index: 1; right: 10px; top: 10px; display: grid; place-items: center; width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--red); font: 700 1.35rem/1 "Segoe UI Symbol", sans-serif; }
.woocommerce ul.products li.product .button, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce button.button.primary, .woocommerce input.button.alt, .woocommerce .button.checkout-button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 8px 9px; border: 0; border-radius: 8px; background: var(--red); color: white; font-weight: 750; font-size: .85rem; text-align: center; }
.woocommerce ul.products li.product .button:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce .button.checkout-button:hover { background: var(--deep-red); color: white; }
.catalog-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; margin-bottom: 13px; padding: 9px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.catalog-controls label { font-size: .84rem; font-weight: 750; }
.catalog-controls select { min-height: 42px; max-width: min(53vw, 250px); border: 1px solid var(--line); padding: 5px; border-radius: 7px; }
.catalog-controls button[aria-pressed=true] { background: var(--pink); border-color: #d692a1; }
body.erchuud-list .woocommerce ul.products { grid-template-columns: minmax(0,1fr); }
body.erchuud-list .woocommerce ul.products li.product { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; }
body.erchuud-list .woocommerce ul.products li.product > a.woocommerce-loop-product__link { display: grid; grid-template-columns: 85px minmax(0,1fr); column-gap: 9px; }
body.erchuud-list .woocommerce ul.products li.product a img { grid-row: span 5; }
body.erchuud-list .save-product { top: 5px; right: 5px; }
.woocommerce .woocommerce-ordering select { min-height: 42px; max-width: 100%; border: 1px solid var(--line); border-radius: 7px; background: white; }
.woocommerce nav.woocommerce-pagination ul { border: 0; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span { display: grid; place-items: center; margin: 1px; min-width: 42px; min-height: 42px; border: 1px solid var(--line); border-radius: 7px; }
.woocommerce div.product .product_title { margin: 0 0 10px; }
.woocommerce div.product .erchuud-gallery { margin-bottom: 18px; clear: none; }
.erchuud-gallery { display: flex; flex-direction: column; gap: 8px; }
.gallery-stage { display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery-stage img, .gallery-stage video { width: 100%; height: 100%; aspect-ratio: 1; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 7px; max-width: 100%; overflow: auto; padding: 3px; }
.gallery-thumbs button { display: grid; place-items: center; width: 63px; min-height: 55px; flex: 0 0 auto; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--red); font-size: .77rem; font-weight: 750; }
.gallery-thumbs button[aria-pressed=true] { border: 2px solid var(--red); }
.gallery-thumbs img { width: 100%; height: 47px; object-fit: contain; }
.gallery-tabs { display: flex; gap: 6px; }
.gallery-tabs button[aria-pressed=true] { background: var(--pink); border-color: var(--red); }
.woocommerce div.product form.cart { display: flow-root; }
.woocommerce div.product form.cart .button { margin: 0 4px 6px 0; }
.woocommerce div.product form.cart .erchuud-buy-now { background: white; border: 1px solid var(--red); border-radius: 8px; color: var(--red); min-height: 43px; font-size: .85rem; }
.quantity .qty { min-height: 43px; }
.woocommerce .quantity .qty { width: 3.5em; }
.qty-change { border: 1px solid var(--line); background: white; color: var(--red); padding: 4px 5px; border-radius: 5px; min-height: 34px; font-size: .74rem; font-weight: 700; }
.cart-remove-label { color: var(--red); font-size: .76rem; font-weight: 700; }
.woocommerce-page .form-row input.input-text, .woocommerce-page .form-row textarea { min-height: 42px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; }
.woocommerce .woocommerce-error, .woocommerce .woocommerce-info, .woocommerce .woocommerce-message { border-top-color: var(--red); }

.store-dialog { width: min(92vw, 520px); max-height: 75vh; padding: 18px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: white; }
.store-dialog::backdrop { background: #21151cb8; }
.dialog-close { position: absolute; inset: 8px 8px auto auto; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--pink); color: var(--red); font-size: 1.55rem; }
.age-gate { text-align: center; padding: 30px 16px 20px; }
.age-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 12px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-size: 1.5rem; font-weight: 875; }
.dialog-primary { display: inline-grid; place-items: center; min-height: 44px; padding-inline: 13px; border: 0; border-radius: 8px; color: white; background: var(--red); font-weight: 750; }
.age-gate [data-age-exit] { display: block; padding: 10px; }
.assistant-toggle { position: fixed; right: 10px; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 2px 10px #6a19313a; }
.assistant-controls { display: flex; gap: 5px; margin-block: 9px; }
.assistant-results { display: grid; gap: 5px; max-height: 290px; overflow: auto; }
.assistant-results a { display: block; border: 1px solid var(--line); border-radius: 7px; padding: 8px; }
.assistant-results a strong { display: block; color: var(--red); }
.assistant-search { display: flex; gap: 4px; }
.assistant-search input { width: 100%; min-width: 0; padding: 6px; border-radius: 7px; border: 1px solid var(--line); }
.desktop-only { display: none; }
.network-status { position: fixed; z-index: 10; top: 0; inset-inline: 0; padding: 9px; background: var(--pink); color: var(--red); text-align: center; font-weight: 700; }

@media (min-width: 700px) {
    .wrap { width: min(calc(100% - 42px), var(--wrap)); }
    .topline span + span { display: inline; }
    .masthead { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding-block: 14px; }
    .store-search { grid-column: auto; grid-row: auto; }
    .head-actions .account-link, .desktop-only { display: inline; }
    .navline { display: flex; gap: clamp(9px, 2.4vw, 27px); align-items: center; min-height: 47px; font-weight: 700; font-size: .86rem; }
    .navline .nav-category, .navline .red-link { color: var(--red); }
    .bottom-nav { display: none; }
    .store-main { padding-top: 24px; }
    .site-footer { padding-bottom: 32px; }
    .footer-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .promo-prev, .promo-next { width: 40px; }
    .promo-prev { left: 6px; }
    .promo-next { right: 6px; }
    .department-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
    .department-grid summary { min-height: 64px; padding: 9px 12px; gap: 8px; }
    .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
    body.erchuud-list .woocommerce ul.products { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .woocommerce div.product .erchuud-gallery { width: 51%; float: left; margin-right: 3%; display: grid; grid-template-columns: 68px minmax(0,1fr); align-items: start; }
    .gallery-tabs { grid-column: 1/-1; grid-row: 1; }
    .gallery-stage { grid-column: 2; grid-row: 2; }
    .gallery-thumbs { flex-direction: column; grid-column: 1; grid-row: 2; max-height: 430px; }
    .woocommerce div.product div.summary { width: 44%; }
    .assistant-toggle { bottom: 12px; }
}
@media (min-width: 990px) {
    .masthead { gap: 22px; }
    .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
    .woocommerce ul.products li.product, .woocommerce-page ul.products li.product { padding: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; } }
