/* ==========================================================================
   ONFIT — Design tokens
   ========================================================================== */
:root {
  /* Color */
  --bone: #efede8;
  --bone-soft: #f6f4f0;
  --ink: #17140f;
  --ink-70: rgba(23, 20, 15, 0.7);
  --ink-45: rgba(23, 20, 15, 0.45);
  --line: #dcd7cc;
  --rose: #b4707a;
  --rose-deep: #8f4d58;
  --rose-tint: #f1e3e2;
  --whatsapp: #25d366;
  --whatsapp-deep: #1da851;
  --white: #fffdfb;

  /* Type */
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  /* Layout */
  --gutter: 20px;
  --radius-s: 4px;
  --radius-m: 14px;
  --radius-l: 26px;
  --nav-h: 62px;
  --shadow-1: 0 2px 10px rgba(23, 20, 15, 0.06);
  --shadow-2: 0 18px 44px rgba(23, 20, 15, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--rose); color: var(--white); }
:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }

/* Very narrow phones (iPhone SE / older Android, ≤340px) */
@media (max-width: 340px) {
  .btn-primary { font-size: 14px; gap: 8px; padding: 14px 10px; }
  .hero__title { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Signature element — the hangtag chip
   Used for REF codes, section eyebrows, size/price tags. A stitched
   swing-tag notch, echoing a real garment label.
   ========================================================================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-70);
  padding: 4px 10px 4px 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  position: relative;
  background: transparent;
}
.tag::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
}
.tag--rose { border-color: var(--rose-deep); color: var(--rose-deep); }
.tag--rose::before { background: var(--rose-deep); }
.tag--light { border-color: rgba(255,253,251,0.5); color: var(--white); }
.tag--light::before { background: var(--white); }

/* ==========================================================================
   Top nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgba(239, 237, 232, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.02em;
}
.nav__logo span { color: var(--rose-deep); }
.nav__actions { display: flex; align-items: center; gap: 14px; }
.nav__icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--ink);
}
.nav__icon-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--rose-deep);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  display: grid;
  place-items: center;
  transform: scale(0);
  transition: transform 0.25s var(--ease);
}
.cart-count.is-visible { transform: scale(1); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 84vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  opacity: 0.92;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 17, 13, 0.15) 0%,
    rgba(20, 17, 13, 0.05) 35%,
    rgba(20, 17, 13, 0.78) 100%
  );
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) 34px;
  color: var(--white);
  width: 100%;
}
.hero__eyebrow { margin-bottom: 14px; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 15vw, 88px);
  line-height: 0.86;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero__sub {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 253, 251, 0.82);
  max-width: 34ch;
  margin-bottom: 22px;
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 100px;
  border: none;
}
.hero__cta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ==========================================================================
   Category pills
   ========================================================================== */
.pills-wrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 30;
  background: var(--bone);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--gutter);
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pill.is-active { background: var(--ink); color: var(--white); }

/* ==========================================================================
   Product grid
   ========================================================================== */
.section-head {
  padding: 34px var(--gutter) 16px;
}
.section-head__eyebrow {
  margin-bottom: 10px;
}
.section-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 0 var(--gutter) 60px;
}

.card {
  background: var(--bone-soft);
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  text-align: left;
  padding: 0;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:active { transform: scale(0.98); }
.card--soldout .card__media img { filter: grayscale(0.55); opacity: 0.65; }
.card--soldout .card__name,
.card--soldout .card__price { color: var(--ink-45); }
.card__soldout-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.card__soldout-badge span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(23, 20, 15, 0.72);
  padding: 7px 18px;
  border-radius: 100px;
  transform: rotate(-8deg);
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card__ref {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(246, 244, 240, 0.92);
  backdrop-filter: blur(4px);
}
.card__swatches {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 5px;
}
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 253, 251, 0.9);
  box-shadow: 0 0 0 1px rgba(23, 20, 15, 0.25);
}
.swatch-dot--soldout { opacity: 0.3; }
.card__body { padding: 12px 12px 14px; }
.card__cat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 4px;
  display: block;
}
.card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.15;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.card__price {
  font-family: var(--font-mono);
  font-size: 15px;
}

/* ==========================================================================
   Overlay + Bottom sheet (product detail)
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 20, 15, 0.5);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: 92vh;
  background: var(--bone-soft);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-2);
  transform: translateY(100%);
  transition: transform 0.38s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet.is-open { transform: translateY(0); }
.sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 12px auto 4px;
  flex: 0 0 auto;
}
.sheet__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 200px;
}
.sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(246, 244, 240, 0.92);
  display: grid;
  place-items: center;
}
.sheet__close svg { width: 16px; height: 16px; flex-shrink: 0; }

.pd__gallery {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--line);
}
.pd__gallery img { width: 100%; height: 100%; object-fit: cover; }
.pd__gallery-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(23, 20, 15, 0.78);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 100px;
}
.pd__body { padding: 18px var(--gutter) 6px; }
.pd__cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose-deep); }
.pd__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  text-transform: uppercase;
  line-height: 1.02;
  margin: 6px 0 10px;
}
.pd__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pd__price { font-family: var(--font-mono); font-size: 20px; }
.pd__desc { font-size: 14px; line-height: 1.6; color: var(--ink-70); margin-bottom: 22px; }

.pd__field { margin-bottom: 20px; }
.pd__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin-bottom: 10px;
  display: block;
}
.pd__stock {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  margin-left: 6px;
}
.pd__stock--low { color: var(--rose-deep); }
.pd__stock--out { color: var(--ink-45); }
.pd__colors { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 2px;
  position: relative;
  background: transparent;
}
.color-swatch__inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(23, 20, 15, 0.15);
}
.color-swatch.is-active { border-color: var(--rose-deep); }
.color-swatch.is-soldout { opacity: 0.4; }
.color-swatch.is-soldout::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 1.5px;
  background: var(--ink);
  transform: rotate(-45deg);
}
.pd__sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.size-pill {
  min-width: 52px;
  padding: 10px 16px;
  border-radius: 100px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}
.size-pill.is-active { background: var(--ink); color: var(--white); }
.size-pill.is-soldout {
  border-color: var(--line);
  color: var(--ink-45);
  text-decoration: line-through;
  text-decoration-color: var(--ink-45);
}

.pd__qty { display: inline-flex; align-items: center; border: 1px solid var(--ink); border-radius: 100px; }
.pd__qty button {
  width: 40px; height: 40px; border: none; background: none; font-size: 18px; color: var(--ink);
}
.pd__qty span { width: 30px; text-align: center; font-family: var(--font-mono); font-size: 14px; }

.sheet__footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px var(--gutter) max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(246,244,240,0) 0%, var(--bone-soft) 30%);
}
.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 100px;
  border: none;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease);
}
.btn-primary svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary--rose { background: var(--rose-deep); }
.btn-primary--whatsapp { background: var(--whatsapp-deep); }
.btn-primary--disabled {
  background: var(--line);
  color: var(--ink-45);
  pointer-events: none;
}
.pd__qty button:disabled { opacity: 0.3; pointer-events: none; }

/* ==========================================================================
   Cart drawer
   ========================================================================== */
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: 90vh;
  background: var(--bone-soft);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-2);
  transform: translateY(100%);
  transition: transform 0.38s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateY(0); }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter) 12px;
  border-bottom: 1px solid var(--line);
}
.drawer__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; }
.drawer__list {
  overflow-y: auto;
  padding: 12px var(--gutter);
  flex: 1 1 auto;
}
.line-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.line-item__img {
  width: 64px;
  height: 80px;
  border-radius: var(--radius-s);
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--line);
}
.line-item__img img { width: 100%; height: 100%; object-fit: cover; }
.line-item__info { flex: 1 1 auto; min-width: 0; }
.line-item__name { font-family: var(--font-display); font-weight: 600; font-size: 15px; text-transform: uppercase; margin-bottom: 3px; }
.line-item__variant { font-family: var(--font-mono); font-size: 11px; color: var(--ink-45); margin-bottom: 6px; }
.line-item__row { display: flex; align-items: center; justify-content: space-between; }
.line-item__qty { display: inline-flex; align-items: center; gap: 8px; }
.line-item__qty button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--ink); background: none; font-size: 14px; line-height: 1;
}
.line-item__qty span { font-family: var(--font-mono); font-size: 13px; min-width: 14px; text-align: center; }
.line-item__price { font-family: var(--font-mono); font-size: 14px; }
.line-item__remove { font-family: var(--font-mono); font-size: 11px; color: var(--ink-45); text-decoration: underline; background: none; border: none; padding: 0; margin-top: 4px; }

.cart-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-45);
}
.cart-empty p { font-size: 14px; margin-top: 10px; }

.grid-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-45);
}
.grid-empty svg { margin: 0 auto; }
.grid-empty p { font-size: 14px; line-height: 1.6; margin-top: 12px; }

.drawer__footer {
  padding: 16px var(--gutter) max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.drawer__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-family: var(--font-display);
  text-transform: uppercase;
}
.drawer__subtotal span:last-child { font-family: var(--font-mono); font-size: 20px; text-transform: none; }

/* ==========================================================================
   Checkout form
   ========================================================================== */
.checkout__field { margin-bottom: 14px; }
.checkout__field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin-bottom: 6px;
}
.checkout__field input,
.checkout__field textarea {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--white);
  color: var(--ink);
  resize: none;
}
.checkout__note {
  font-size: 12px;
  color: var(--ink-45);
  line-height: 1.5;
  margin-top: 4px;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--rose); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 46px var(--gutter) 40px;
  background: var(--ink);
  color: var(--white);
}
.footer__logo { font-family: var(--font-display); font-weight: 700; font-size: 28px; margin-bottom: 10px; }
.footer__logo span { color: var(--rose); }
.footer__text { font-size: 13px; color: rgba(255,253,251,0.6); max-width: 40ch; line-height: 1.6; margin-bottom: 22px; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links a { font-size: 13px; color: rgba(255,253,251,0.85); display: inline-flex; align-items: center; gap: 8px; }
.footer__links svg { width: 15px; height: 15px; flex-shrink: 0; }
.footer__meta { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,253,251,0.12); font-family: var(--font-mono); font-size: 11px; color: rgba(255,253,251,0.4); }

/* ==========================================================================
   Floating WhatsApp / cart bar (mobile persistent)
   ========================================================================== */
.floating-cart {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--white);
  padding: 12px 12px 12px 18px;
  border-radius: 100px;
  box-shadow: var(--shadow-2);
  transform: translateY(140%);
  transition: transform 0.3s var(--ease);
}
.floating-cart.is-visible { transform: translateY(0); }
.floating-cart__label { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: 14px; flex: 1 1 auto; }
.floating-cart__total { font-family: var(--font-mono); font-size: 14px; margin-right: 4px; }
.floating-cart__btn {
  background: var(--rose);
  color: var(--ink);
  border: none;
  border-radius: 100px;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
}

/* ==========================================================================
   Tablet (iPad portrait and similar mid-size screens)
   ========================================================================== */
@media (min-width: 620px) and (max-width: 859px) {
  :root { --gutter: 32px; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  .hero__content { max-width: 520px; }
}

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 860px) {
  :root { --gutter: 48px; }

  .hero { min-height: 78vh; }
  .hero__content { max-width: 640px; padding-bottom: 64px; }

  .grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
  .card__name { font-size: 18px; }

  .sheet, .drawer {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 420px;
    max-height: calc(100vh - 48px);
    border-radius: 22px;
    transform: translate(0, 24px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s var(--ease), opacity 0.32s var(--ease);
  }
  .sheet.is-open, .drawer.is-open {
    transform: translate(0, 0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  .floating-cart { left: auto; width: 340px; }
}

/* ==========================================================================
   Large desktop / ultra-wide — cap content width, add breathing room
   ========================================================================== */
@media (min-width: 1440px) {
  .section-head, .grid, .pills, .hero__content {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1680px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
