/* ==========================================================================
   Dahab v24 storefront: base.css (owner LAYOUT)
   Fonts, tokens, reset, typography, buttons, eyebrows, section chrome,
   utilities, scroll lock, focus/selection, reduced motion.

   Cascade model (same as the reference build):
   - The Tailwind preflight and the shadcn/ui primitives live in LOW-PRIORITY
     cascade layers (theme < base < components < utilities).
   - Every hand-written storefront rule (this file below the layers, and all the
     other dahab/*.css files) is UNLAYERED, so it always beats the layers,
     whatever its specificity. That reproduces the reference quirks exactly
     (e.g. `button{font:inherit;color:inherit;border:0}` beating shadcn's
     text-sm / font-medium / border utilities).
   ========================================================================== */

@layer theme, base, components, utilities;

/* ---------- 1. Fonts (spec 01 §2) ---------- */
@font-face{font-family:Damas;src:url(/fonts/damas/damas-sep21-100.otf) format("opentype");font-weight:100;font-style:normal;font-display:swap}
@font-face{font-family:Damas;src:url(/fonts/damas/damas-sep21-200.otf) format("opentype");font-weight:200;font-style:normal;font-display:swap}
@font-face{font-family:Damas;src:url(/fonts/damas/damas-sep21-300.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:Damas;src:url(/fonts/damas/damas-sep21-500.otf) format("opentype");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:Damas;src:url(/fonts/damas/damas-sep21-600.otf) format("opentype");font-weight:600;font-style:normal;font-display:swap}

/* ---------- 2. Tokens (spec 01 §3.1, verbatim) ---------- */
:root{--background:#fffaf8;--foreground:#4d1834;--card:#fff;--card-foreground:#4d1834;--popover:#fffaf8;--popover-foreground:#4d1834;
--primary:#571b3b;--primary-foreground:#fffaf8;--secondary:#f5d5e2;--secondary-foreground:#4d1834;--muted:#f3e8e9;--muted-foreground:#755a68;
--accent:#efc9d9;--accent-foreground:#4d1834;--destructive:#ae2f45;--border:#4d183421;--input:#4d183430;--ring:#af5b7d;--radius:.7rem;
--gold:#b3813c;--font-sans:Damas,Arial,sans-serif}

@layer theme{
  :root{--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;
    --text-xs:.75rem;--text-sm:.875rem;--text-base:1rem;--text-lg:1.125rem;
    --radius-xs:.125rem;--radius-sm:.25rem;--radius-md:.375rem;--radius-xl:.75rem;
    --ease-in-out:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);
    --default-font-family:Damas,Arial,sans-serif;--color-border:var(--border)}
}

/* ---------- 3. Preflight (Tailwind v4 @layer base, the parts the storefront relies on) ---------- */
@layer base{
  *,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}
  html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family);-webkit-tap-highlight-color:transparent}
  hr{height:0;color:inherit;border-top-width:1px}
  h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}
  a{color:inherit;text-decoration:inherit}
  b,strong{font-weight:bolder}
  small{font-size:80%}
  sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}
  sub{bottom:-.25em}
  sup{top:-.5em}
  table{text-indent:0;border-color:inherit;border-collapse:collapse}
  summary{display:list-item}
  ol,ul,menu{list-style:none}
  img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}
  img,video{max-width:100%;height:auto}
  button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}
  ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}
  textarea{resize:vertical}
  ::-webkit-search-decoration{-webkit-appearance:none}
  button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;appearance:button}
  ::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}
  [hidden]:where(:not([hidden=until-found])){display:none!important}
}

/* ---------- 4. shadcn/ui primitives (low priority, like the reference utilities) ----------
   Markup contract (copy the reference): <button data-slot="button" data-variant="ghost|default|outline|secondary|link"
   data-size="default|sm|lg|icon|icon-sm|icon-lg">. SheetTrigger/SheetClose/DialogClose buttons carry the same
   data-variant/data-size attributes. Any unlayered component rule overrides these. */
@layer components{
  [data-variant][data-size]{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;gap:8px;border-radius:var(--radius-md);
    font-size:var(--text-sm);line-height:calc(1.25/.875);font-weight:500;white-space:nowrap;outline:none;
    transition:all var(--default-transition-duration) var(--default-transition-timing-function)}
  [data-variant][data-size] svg{pointer-events:none;flex-shrink:0}
  [data-variant][data-size] svg:not([class*='size-']){width:16px;height:16px}
  [data-variant][data-size]:focus-visible{border-color:var(--ring);box-shadow:0 0 0 3px color-mix(in oklab,var(--ring) 50%,transparent)}
  [data-variant][data-size]:disabled{pointer-events:none;opacity:.5}
  [data-variant=default][data-size]{background-color:var(--primary);color:var(--primary-foreground)}
  [data-variant=secondary][data-size]{background-color:var(--secondary);color:var(--secondary-foreground)}
  [data-variant=outline][data-size]{border-width:1px;background-color:var(--background);box-shadow:0 1px 2px 0 #0000000d}
  [data-variant=link][data-size]{color:var(--primary);text-underline-offset:4px}
  @media (hover:hover){
    [data-variant=default][data-size]:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}
    [data-variant=secondary][data-size]:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}
    [data-variant=outline][data-size]:hover,[data-variant=ghost][data-size]:hover{background-color:var(--accent);color:var(--accent-foreground)}
    [data-variant=link][data-size]:hover{text-decoration-line:underline}
  }
  [data-size=default]{height:36px;padding:8px 16px}
  [data-size=default]:has(>svg){padding-inline:12px}
  [data-size=sm]{height:32px;gap:6px;padding-inline:12px}
  [data-size=sm]:has(>svg){padding-inline:10px}
  [data-size=lg]{height:40px;padding-inline:24px}
  [data-size=lg]:has(>svg){padding-inline:16px}
  [data-size=icon]{width:36px;height:36px}
  [data-size=icon-sm]{width:32px;height:32px}
  [data-size=icon-lg]{width:40px;height:40px}
}

@layer utilities{
  .sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}
  .not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}
}

/* ---------- 5. Site base (unlayered; final cascade of spec 01 §3.2) ---------- */
html{scroll-behavior:smooth;scroll-padding-top:105px;font-synthesis:none}
body{background:#fffafc;color:#501d39;margin:0;font:300 17px/1.7 Damas,Arial,sans-serif}
.storefront{background:#fffafc}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
a{color:inherit;text-decoration:none}
button:disabled{cursor:default}
img{max-width:100%;display:block}
:is(button:focus-visible,a:focus-visible){outline-offset:6px;outline:2px solid #9a3c6d}
h1,h2,h3,p{margin:0}
h1,h2,h3{font-family:Damas,Arial,sans-serif;font-weight:600}
button{border:0}
::selection{color:#fff;background:#852e55}
.shop-header-actions [data-slot=button],.storefront [data-slot=button]{font-family:inherit}
svg[data-product-image]{max-width:100%;display:block;overflow:visible}

/* Logo image (header 90 / 76 at <=900; footer, menu, ribbon, about override with more specific selectors) */
.brand-logo{object-fit:contain;flex-shrink:0;width:90px;height:90px}
@media (max-width:900px){.brand-logo{width:76px;height:76px}}

/* ---------- 6. Skip link (spec 01 §3.4; stays at the physical right in both directions) ---------- */
.skip-link{z-index:100;color:#fff;background:#571b3b;padding:12px 20px;position:fixed;top:-90px;right:20px}
.skip-link:focus{top:10px}

/* ---------- 7. Scroll lock while a menu / sheet / dialog is open (G12, react-remove-scroll) ----------
   Protocol shared by dahab-site.js and dahab-shop.js:
   body[data-scroll-locked] is a counter ("1", "2", ...). The first locker measures
   gap = innerWidth - documentElement.clientWidth and sets body.style '--removed-body-scroll-bar-size: {gap}px';
   the last unlocker removes the attribute and the property. */
body[data-scroll-locked]{overflow:hidden!important;overscroll-behavior:contain;position:relative!important;margin-left:0;margin-top:0;
  margin-right:var(--removed-body-scroll-bar-size,0px)!important}

/* ---------- 8. Eyebrows (spec 01 §3.7) ---------- */
.eyebrow{color:#966a79;margin-bottom:12px;font-size:14px;display:block}
.eyebrow[dir=ltr]{letter-spacing:2px;font:12px/1.5 Damas,Arial,sans-serif}
@media (max-width:800px){.eyebrow{margin-bottom:8px;font-size:13px}}

/* ---------- 9. Section chrome (spec 03 §0.2) ---------- */
.section{max-width:1800px;margin:auto;padding:94px 5.2%}
.section-heading{justify-content:space-between;align-items:end;gap:25px;margin-bottom:38px;display:flex}
.section-heading h2{letter-spacing:-.5px;font-size:40px;font-weight:500;line-height:1.6}
.section-heading>p{color:#876a77;margin-bottom:8px;font-size:17px}
.text-link{border-bottom:1px solid #7740575c;align-items:center;gap:14px;padding-bottom:6px;font-size:16px;display:inline-flex}
.text-link:hover{color:#a34e75}
@media (max-width:800px){
  .section{padding:60px 6%}
  .section-heading{align-items:start;gap:15px;margin-bottom:28px}
  .section-heading h2{font-size:31px}
  .section-heading>p{display:none}
  .section-heading .text-link{align-self:end;gap:7px;max-width:160px;font-size:14px}
}
@media (max-width:480px){
  .section-heading h2{font-size:28px}
  .section-heading .text-link{max-width:126px;font-size:13px}
}

/* ---------- 10. Buttons (spec 01 §3.8 / §10) ---------- */
.button{border-radius:50px;justify-content:center;align-items:center;gap:36px;min-height:58px;padding:16px 30px;font-family:Damas,Arial,sans-serif;
  font-size:17px;font-weight:500;line-height:1.35;transition:background .2s,transform .25s;display:inline-flex}
.button:hover{transform:translateY(-3px)}
.button-dark{color:#fffaf8;background:#571b3b}
.button-dark:hover{background:#722b4e}
.button-light{color:#571b3b;background:#fff6eb}

/* Primary pill used by product cards, the product dialog and bundle cards */
.add-to-cart{display:inline-flex;align-items:center;justify-content:center;color:#fff;background:#5b1e3d;gap:10px;width:100%;height:46px!important;
  box-shadow:none!important;border-radius:30px!important;font:500 16px Damas,Arial,sans-serif!important}
.add-to-cart svg{width:16px;height:16px;flex-shrink:0;pointer-events:none}
.add-to-cart:hover{background:#7b2b51}
.add-to-cart:disabled{color:#886779;opacity:1;background:#efe4e9}
@media (max-width:600px){
  .add-to-cart{gap:7px;height:42px!important;font-size:14px!important}
  .add-to-cart svg{width:15px}
}

/* ---------- 11. Reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,:before,:after{transition:none!important;animation:none!important}
  .reveal{opacity:1!important;transform:none!important}
}
