/* =========================================================================
   SAJIEL — Design tokens
   Color   : #FFFFFF canvas · #111111 ink · #6B6660 muted text
             #E7E4DE structural border · #A9895C bronze accent (sparing)
   Type    : "Fraunces" (editorial serif, display) + "Inter" (UI/body)
   Layout  : left-aligned editorial grid, asymmetric hero, generous air
   ========================================================================= */

:root {
  --paper: #FFFFFF;
  --ink: #111111;
  --ink-soft: #4A4742;
  --muted: #7A756E;
  --border: #E7E4DE;
  --border-strong: #D8D4CC;
  --bronze: #A9895C;
  --bronze-deep: #8C6F45;
  --sale: #B4472E;
  --surface: #FAF9F7;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.4,0,.2,1);
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 560; margin: 0; letter-spacing: -0.01em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: var(--bronze-deep); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--full { width: 100%; padding: 16px 20px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* =========================================================================
   Preloader
   ========================================================================= */
.preloader {
  position: fixed; inset: 0; z-index: 999;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .7s var(--ease), visibility .7s var(--ease);
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader__mark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(28px, 6vw, 44px);
  letter-spacing: 0.28em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  animation: sajielFadeIn 1s var(--ease) forwards .15s;
}
.preloader__bar {
  width: 160px; height: 1px; margin-top: 26px;
  background: var(--border);
  overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: var(--ink);
  animation: sajielBar 1.6s var(--ease) forwards .5s;
}
@keyframes sajielFadeIn { to { opacity: 1; transform: translateY(0); } }
@keyframes sajielBar { to { width: 100%; } }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 60;
  /* Solid (not backdrop-filter) background on purpose: backdrop-filter on
     an ancestor creates a new containing block for position:fixed children
     in most browsers, which traps the fixed mobile-nav drawer inside the
     76px header bar instead of letting it cover the viewport. */
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1360px; margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.24em;
}
.primary-nav { display: flex; gap: 36px; }
.primary-nav a {
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  transition: color .2s var(--ease);
  position: relative;
  padding-bottom: 3px;
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--ink); transition: right .3s var(--ease);
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); position: relative; border-radius: 50%;
  transition: background .2s var(--ease);
}
.icon-btn:hover { background: var(--surface); }
.cart-count {
  position: absolute; top: 2px; right: 2px;
  background: var(--ink); color: var(--paper);
  font-size: 10px; font-weight: 600; line-height: 1;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.nav-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 32px; height: 32px; }
.nav-toggle span { width: 20px; height: 1px; background: var(--ink); transition: transform .25s var(--ease), opacity .25s var(--ease); }

.primary-nav__head { display: none; }

/* Search overlay */
.search-bar {
  max-height: 0; overflow: hidden;
  border-bottom: 0px solid var(--border);
  transition: max-height .4s var(--ease), border-color .4s var(--ease);
}
.search-bar.is-open { max-height: 90px; border-bottom: 1px solid var(--border); }
.search-bar__inner {
  max-width: 1360px; margin: 0 auto; padding: 20px 32px;
  display: flex; align-items: center; gap: 14px; color: var(--muted);
}
.search-bar__inner input {
  flex: 1; border: none; outline: none; font-size: 18px; font-family: var(--serif);
  color: var(--ink); background: transparent;
}
.search-bar__inner input::placeholder { color: var(--muted); font-family: var(--sans); font-size: 15px; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 60px;
  padding: 76px 32px 100px;
}
.hero__eyebrow {
  font-size: 12.5px; letter-spacing: 0.14em; color: var(--bronze-deep);
  margin: 0 0 18px;
  font-weight: 600;
}
.hero__title {
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.04;
  margin-bottom: 24px;
}
.hero__desc {
  max-width: 42ch; color: var(--ink-soft); font-size: 16px; line-height: 1.65;
  margin-bottom: 34px;
}
.hero__frame {
  aspect-ratio: 4/5; overflow: hidden; background: var(--surface);
  border-radius: 2px;
}
.hero__frame img { width: 100%; height: 100%; object-fit: cover; }

/* Hero slider */
.hero-slider {
  position: relative;
  aspect-ratio: 4/5; overflow: hidden;
  background: var(--surface);
  border-radius: 2px;
}
.hero-slider__track {
  display: flex; width: 100%; height: 100%;
}
.hero-slider__slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  opacity: 0;
  position: relative; margin-left: -100%;
  transition: opacity .8s var(--ease);
  pointer-events: none;
}
.hero-slider__slide:first-child { margin-left: 0; }
.hero-slider__slide.is-active { opacity: 1; pointer-events: auto; position: relative; }
.hero-slider__slide img { width: 100%; height: 100%; object-fit: cover; }

.hero-slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); z-index: 3;
  opacity: 0; transition: opacity .25s var(--ease), background .2s var(--ease);
}
.hero-slider:hover .hero-slider__arrow { opacity: 1; }
.hero-slider__arrow:hover { background: var(--paper); }
.hero-slider__arrow--prev { left: 16px; }
.hero-slider__arrow--next { right: 16px; }

.hero-slider__dots {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 3;
}
.hero-slider__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(17,17,17,.15);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.hero-slider__dot.is-active { background: var(--paper); transform: scale(1.3); }

/* =========================================================================
   Collection / product grid
   ========================================================================= */
.collection { max-width: 1360px; margin: 0 auto; padding: 20px 32px 110px; }
.collection__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 26px; margin-bottom: 8px;
}
.collection__head h2 { font-size: 30px; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 8px 16px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--ink); color: var(--ink); }
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.collection__meta { color: var(--muted); font-size: 13px; margin: 18px 0 30px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
}
.product-card {
  cursor: pointer;
  opacity: 0; transform: translateY(14px);
  animation: sajielCardIn .6s var(--ease) forwards;
}
@keyframes sajielCardIn { to { opacity: 1; transform: translateY(0); } }

.product-card__frame {
  position: relative; aspect-ratio: 4/5; overflow: hidden;
  background: var(--surface);
  border-radius: 2px;
  margin-bottom: 16px;
}
.product-card__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.product-card:hover .product-card__frame img { transform: scale(1.045); }

.tag {
  position: absolute; top: 12px; left: 12px;
  font-size: 10.5px; letter-spacing: 0.06em; font-weight: 600;
  padding: 5px 10px; border-radius: 2px;
  background: var(--paper); color: var(--ink);
}
.tag--sale { background: var(--sale); color: var(--paper); }
.tag--low { top: auto; bottom: 12px; left: 12px; background: rgba(17,17,17,.86); color: var(--paper); }

.btn--quickview {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  background: var(--paper); color: var(--ink);
  padding: 12px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  border-radius: 2px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.tag--low + .btn--quickview,
.tag--sale ~ .btn--quickview { bottom: 12px; }
.product-card:hover .btn--quickview,
.product-card:focus-within .btn--quickview { opacity: 1; transform: translateY(0); }

.product-card__category { font-size: 11.5px; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 5px; }
.product-card__title { font-size: 17px; font-weight: 440; margin: 0 0 8px; line-height: 1.3; }
.product-card__price { font-size: 14.5px; font-weight: 600; color: var(--ink); display: flex; gap: 8px; }
.product-card__price s { font-weight: 400; color: var(--muted); }

.empty-state { text-align: center; padding: 80px 0; color: var(--muted); }
.empty-state .btn { margin-top: 18px; }

/* Skeleton pulse cards while fetching */
.product-card.is-skeleton .product-card__frame { animation: sajielPulse 1.4s ease-in-out infinite; }
.product-card.is-skeleton .product-card__title,
.product-card.is-skeleton .product-card__price { background: var(--surface); border-radius: 2px; color: transparent; animation: sajielPulse 1.4s ease-in-out infinite; }
@keyframes sajielPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* =========================================================================
   Editorial strip
   ========================================================================= */
.editorial-strip {
  background: var(--surface);
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.editorial-strip__panel { padding: 90px 64px; display: flex; flex-direction: column; justify-content: center; max-width: 520px; }
.editorial-strip__panel h2 { font-size: 34px; margin: 0 0 18px; line-height: 1.15; }
.editorial-strip__panel p:not(.hero__eyebrow) { color: var(--ink-soft); line-height: 1.7; }
.editorial-strip__panel--img { padding: 0; max-width: none; }
.editorial-strip__panel--img img { width: 100%; height: 100%; object-fit: cover; min-height: 380px; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { border-top: 1px solid var(--border); padding: 70px 32px 30px; }
.site-footer__inner {
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.wordmark--footer { font-size: 18px; margin: 0 0 10px; }
.site-footer__brand p:not(.wordmark--footer) { color: var(--muted); font-size: 14px; }
.site-footer__col h4 { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 16px; font-weight: 600; }
.site-footer__col a { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.site-footer__col a:hover { color: var(--ink); }
.site-footer__legal { max-width: 1360px; margin: 50px auto 0; font-size: 12.5px; color: var(--muted); }

/* =========================================================================
   Scrim
   ========================================================================= */
.scrim {
  position: fixed; inset: 0; background: rgba(17,17,17,.4);
  opacity: 0; visibility: hidden; z-index: 70;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
.scrim.is-visible { opacity: 1; visibility: visible; }

/* =========================================================================
   Cart drawer
   ========================================================================= */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: var(--paper); z-index: 80;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .45s var(--ease);
  box-shadow: -20px 0 60px rgba(17,17,17,.06);
}
.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 28px; border-bottom: 1px solid var(--border);
}
.cart-drawer__head h2 { font-size: 20px; }
.cart-drawer__body { flex: 1; overflow-y: auto; padding: 10px 28px; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 60px; font-size: 14px; }

.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item {
  display: grid; grid-template-columns: 76px 1fr auto;
  gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border);
  align-items: flex-start;
  animation: sajielFadeIn .4s var(--ease);
}
.cart-item__frame { width: 76px; height: 95px; overflow: hidden; background: var(--surface); border-radius: 2px; }
.cart-item__frame img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__title { font-size: 14.5px; font-weight: 500; margin: 0 0 4px; }
.cart-item__variant { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.cart-item__qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 999px; }
.cart-item__qty button { width: 26px; height: 26px; font-size: 15px; }
.cart-item__qty span { font-size: 13px; min-width: 20px; text-align: center; }
.cart-item__price { font-size: 14px; font-weight: 600; text-align: right; }
.cart-item__remove { font-size: 12px; color: var(--muted); margin-top: 10px; display: block; }
.cart-item__remove:hover { color: var(--sale); }

.cart-drawer__foot { padding: 22px 28px 28px; border-top: 1px solid var(--border); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.cart-note { font-size: 12px; color: var(--muted); margin: 0 0 18px; }

/* =========================================================================
   Modals (shared)
   ========================================================================= */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
  background: rgba(17,17,17,.45);
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal__panel {
  background: var(--paper); border-radius: 3px;
  max-width: 920px; width: 100%; max-height: 88vh; overflow-y: auto;
  position: relative;
  transform: translateY(18px) scale(.98);
  transition: transform .4s var(--ease);
}
.modal.is-open .modal__panel { transform: translateY(0) scale(1); }

.modal__close {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  font-size: 22px; background: var(--paper);
  width: 36px; height: 36px; border-radius: 50%;
}

/* Quick view */
.modal__panel--product { padding: 0; }
.modal__skeleton, .modal__content--grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.skeleton { background: var(--surface); animation: sajielPulse 1.4s ease-in-out infinite; border-radius: 2px; }
.skeleton--img { aspect-ratio: 4/5; }
.skeleton-lines { padding: 60px 48px; display: flex; flex-direction: column; gap: 14px; }
.skeleton--line { height: 14px; }

.qv-media { aspect-ratio: 4/5; overflow: hidden; background: var(--surface); }
.qv-media img { width: 100%; height: 100%; object-fit: cover; }
.qv-body { padding: 56px 48px; display: flex; flex-direction: column; }
.qv-category { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.qv-title { font-size: 27px; margin: 0 0 12px; line-height: 1.2; }
.qv-price { font-size: 17px; font-weight: 600; margin: 0 0 20px; display: flex; gap: 10px; }
.qv-price s { color: var(--muted); font-weight: 400; }
.qv-desc { color: var(--ink-soft); font-size: 14.5px; line-height: 1.7; margin: 0 0 28px; }

.variant-group { margin-bottom: 22px; }
.variant-group__label { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; margin: 0 0 10px; }
.variant-options { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-option {
  padding: 9px 15px; font-size: 13px; border: 1px solid var(--border-strong);
  border-radius: 999px; transition: all .2s var(--ease);
}
.variant-option:hover { border-color: var(--ink); }
.variant-option.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.qv-stock { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.qv-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* Checkout modal */
.modal__panel--checkout { max-width: 520px; padding: 52px 44px 44px; }
.modal__title { font-size: 26px; margin-bottom: 6px; }
.modal__subtitle { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.modal__subtitle strong { color: var(--ink); }

.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 22px; }
.pay-tab {
  border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 14px 16px; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.pay-tab:hover { border-color: var(--ink); }
.pay-tab.is-active { border-color: var(--ink); background: var(--surface); }
.pay-tab__label { font-size: 14px; font-weight: 600; }
.pay-tab__sub { font-size: 11.5px; color: var(--muted); }

.pay-detail {
  background: var(--surface); border-radius: 3px; padding: 20px 22px;
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 24px;
  min-height: 60px;
}
.pay-detail strong { color: var(--ink); }
.pay-detail .afterpay-estimate { font-size: 16px; font-weight: 600; color: var(--ink); margin-top: 6px; }

.pay-error { color: var(--sale); font-size: 13px; margin: 14px 0 0; text-align: center; }

/* =========================================================================
   Toast
   ========================================================================= */
.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 120;
  transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper);
  padding: 14px 24px; border-radius: 3px; font-size: 13.5px;
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s var(--ease);
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 50px; }
  .hero__frame, .hero-slider { order: -1; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .editorial-strip { grid-template-columns: 1fr; }
  .editorial-strip__panel { padding: 56px 32px; max-width: none; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: flex; }

  /* Off-canvas mobile nav drawer */
  .primary-nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 95;
    width: min(320px, 84vw);
    background: var(--paper);
    display: flex; flex-direction: column; gap: 2px;
    padding: 0 8px 30px;
    transform: translateX(-100%);
    transition: transform .4s var(--ease);
    box-shadow: 20px 0 60px rgba(17,17,17,.06);
    overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateX(0); }

  .primary-nav__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 16px; margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .wordmark--nav { font-size: 18px; }

  .nav-link {
    padding: 15px 16px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
  }
}

@media (min-width: 981px) {
  .primary-nav { display: flex; }
}

@media (max-width: 640px) {
  .site-header__inner { padding: 0 18px; }
  .hero { padding: 40px 18px 60px; gap: 32px; }
  .collection { padding: 20px 18px 80px; }
  .product-grid { gap: 28px 16px; }
  .qv-media, .modal__skeleton .skeleton--img { aspect-ratio: 1/1; }
  .modal__skeleton, .modal__content--grid { grid-template-columns: 1fr; }
  .qv-body { padding: 32px 24px 40px; }
  .pay-tabs { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .cart-drawer { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
