/*
 * MORI NO MONOGATARI theme.
 * 1) Re-points the storefront's global tokens (style.css :root) to the MORI palette and type,
 *    so cart, checkout, account and policy pages pick up the brand without per-page rewrites.
 * 2) Glue for the MORI header / footer (layout/mori-header.ejs, layout/mori-footer.ejs).
 */
:root {
    --mori-bg: #F4EEE4;
    --mori-paper: #F8F3EB;
    --mori-card: #FBF8F2;
    --mori-ink: #1C2B20;
    --mori-text: #2B2B27;
    --mori-muted: #6A665C;
    --mori-line: #DCD3C3;
    --mori-sage: #A3AC7E;
    --mori-forest: #1F3527;
    --mori-forest-deep: #16291C;
    --mori-on-dark: #F4F0E7;
    --mori-font-display: 'Playfair Display', 'Times New Roman', serif;
    --mori-font-sans: 'Inter', system-ui, sans-serif;
    --mori-font-thin: 'Jost', system-ui, sans-serif;

    --primary-color: var(--mori-bg);
    --secondary-color: var(--mori-paper);
    --third-color: var(--mori-muted);
    --color-brown: var(--mori-text);
    --color-grey: var(--mori-line);
    --color-black: var(--mori-ink);
    --footer-bg: var(--mori-forest-deep);
    --content-bg: var(--mori-bg);
    --header-bg: var(--mori-paper);
    --content-text: var(--mori-text);
    --content-heading: var(--mori-ink);
    --content-text-muted: var(--mori-muted);
    --interactive-color: var(--mori-forest);
    --interactive-muted: rgba(28, 43, 32, 0.62);
    --font-family-base: var(--mori-font-sans);
    --font-family-menu: var(--mori-font-sans);
    --font-family-brand: var(--mori-font-display);
    --font-family-global: var(--mori-font-sans);
    --pd-font-brand: var(--mori-font-display);
    --pd-font-body: var(--mori-font-sans);
}

body {
    background-color: var(--mori-bg);
    color: var(--mori-text);
    font-family: var(--mori-font-sans);
}

html[lang="zh"] .mori-home *,
html[lang="zh"] .mori-pdp *,
html[lang="zh"] .mori-chrome * { font-style: normal !important; }

/* ---------- Header ---------- */
.mori-header-root { position: sticky; top: 0; z-index: 1030; background: transparent; font-size: 16px; }
.mori-chrome .site-header { position: relative; }
.mori-chrome a { text-decoration: none; }
.mori-chrome h2, .mori-chrome p, .mori-chrome ul, .mori-chrome figure { margin: 0; }
.mori-chrome ul { padding: 0; list-style: none; }
.mori-chrome img { max-width: 100%; display: block; }
.mori-chrome .bag-btn { position: relative; }
.mori-chrome .cart-count[hidden] { display: none; }
.mori-chrome .acct-btn { margin-right: -6px; }
.mori-chrome .ls-menu a {
    display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 0 12px;
    border-radius: 6px; color: inherit; font-family: var(--mori-font-sans); font-size: 14px; letter-spacing: .02em;
}
.mori-chrome .ls-menu a:hover { background: #EFE8DA; }
.mori-chrome .ls-menu a[aria-checked="true"] { font-weight: 600; }
.mori-chrome .ls-menu a[aria-checked="true"]::after {
    content: ""; width: 9px; height: 5px; margin-left: 12px; border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor; transform: rotate(-45deg) translateY(-2px);
}
.mori-chrome .drawer .ls-menu a { min-height: 44px; border-bottom: 0; text-transform: none; letter-spacing: .02em; font-size: 14px; }
.mori-announcement .announcement-bar { background: var(--mori-forest); color: var(--mori-on-dark); font-family: var(--mori-font-sans); }

/* ---------- Footer ---------- */
.mori-chrome .mf .fld label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared components (cart drawer, modals, buttons) ---------- */
.btn-dark, .btn-primary { --bs-btn-bg: var(--mori-forest); --bs-btn-border-color: var(--mori-forest); --bs-btn-hover-bg: var(--mori-forest-deep); --bs-btn-hover-border-color: var(--mori-forest-deep); --bs-btn-active-bg: var(--mori-forest-deep); }

/* Primary actions: forest green instead of the old black (selectors from the storefront stylesheets). */
.shop-cart-view-btn, .cart-checkout-btn, .shop-login-submit-btn, .checkout-success-btn--primary,
.error-not-found-actions .btn-home, .gwp-confirm-bar__confirm, .pdp-gwp-root .gwp-confirm-bar__confirm,
.storefront-popup__newsletter button, .cart-page .cart-page-pwp-add-btn, .product-card button,
.shop-cart-drawer .product-card-tile--cart-rec .add-to-cart-btn, :is(.add-to-cart-btn, .add-to-cart),
.account-address-btn, .vouchers-redeem-row button, .account-update-password-btn,
.swal2-popup.share-preview-modal .share-preview-modal__confirm, .sticky-add-bar__add-btn, .primary-add-btn,
.contact-form__submit {
    background: var(--mori-forest) !important;
    border-color: var(--mori-forest) !important;
    color: var(--mori-on-dark) !important;
}
.shop-cart-view-btn:hover, .cart-checkout-btn:hover, .shop-login-submit-btn:hover, .checkout-success-btn--primary:hover,
.error-not-found-actions .btn-home:hover, .product-card button:hover, :is(.add-to-cart-btn, .add-to-cart):hover,
.account-address-btn:hover, .account-update-password-btn:hover, .primary-add-btn:hover, .contact-form__submit:hover:not(:disabled) {
    background: var(--mori-forest-deep) !important;
    border-color: var(--mori-forest-deep) !important;
}
.size-btn.active, .product-page-current, .checkout-success-steps li.is-done::before, .checkout-success-steps li.is-active::before {
    background: var(--mori-forest) !important;
    border-color: var(--mori-forest) !important;
}
/* Headings in shared pages use the MORI display face. */
.cart-page h1, .checkout-page h1, .account-page h1, .legal-page h1, .contact-page__title, .error-not-found h1,
.shop-cart-drawer .shop-cart-title, .contact-page__section-title {
    font-family: var(--mori-font-display);
    font-weight: 400;
    color: var(--mori-ink);
}

/* Small screens follow the design (menu · logo · bag); sign-in lives in the drawer. */
@media (max-width: 1000px) {
    .mori-chrome .acct-btn { display: none; }
}

/* Contact form honeypot (spam trap) */
.mori-help .ct-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Header ≤1000px: the language switcher takes the free space, so everything after it (account, bag)
   sits flush right. The account icon between them used to break the "lang + bag" rule and pushed the
   switcher under the centred logo. */
@media (min-width: 600px) and (max-width: 1000px) {
    .mori-chrome .site-header .lang-sw.hd ~ [data-bag-open],
    .mori-chrome .site-header .lang-sw.hd ~ .acct-btn { margin-left: 0; }
}
