/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f4f1e7;   /* cream — color fondo de marca */
  --bg-2:      #e8e0cd;   /* sand, un tono más oscuro */
  --paper:     #ffffff;
  --ink:       #241a17;   /* casi negro, tibio */
  --ink-soft:  #3a2c27;
  --ink-mute:  #756a5f;
  --accent:    #bc2a2c;   /* rojo marca */
  --accent-dark: #8f1f21;
  --accent-soft: rgba(188,42,44,0.10);
  --line:      rgba(36,26,23,0.12);
  --line-strong: rgba(36,26,23,0.22);

  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --container: 1180px;
  --nav-h: 84px;
  --radius: 18px;
  --radius-sm: 10px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--font-display); font-weight: 600; }
em { font-style: italic; color: var(--accent); font-weight: 500; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.section-num {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .2rem .7rem;
  margin-bottom: 1rem;
}

/* Reveal-on-scroll: defensive rule keeps content visible if JS never runs */
.reveal { opacity: 1; transform: none; }
.reveal.js-armed { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.js-armed.is-visible { opacity: 1; transform: none; }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out), box-shadow .35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 10px 24px -12px rgba(188,42,44,0.55);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-add {
  padding: .6rem 1.1rem;
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--bg);
}
.btn-add:hover { background: var(--accent); }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(244,241,231,0.7);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease-out), background .3s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(244,241,231,0.92);
  border-bottom-color: var(--line);
}
@supports not (backdrop-filter: blur(1px)) {
  .nav { background: rgba(244,241,231,0.98); }
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-brand img { height: 52px; width: auto; }
.nav-links {
  display: none;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: color .3s var(--ease-out), transform .3s var(--ease-out);
}
.nav-links a::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: inherit;
  transform: scale(0.6);
  opacity: 0;
  transition: transform .45s var(--ease-bounce), opacity .3s var(--ease-out);
  z-index: -1;
}
.nav-links a::after {
  content: "";
  display: inline-block;
  width: 0; height: 5px;
  margin-left: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s var(--ease-out), margin-left .3s var(--ease-out);
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent-dark);
  transform: translateY(-1px);
}
.nav-links a:hover::before,
.nav-links a:focus-visible::before { transform: scale(1); opacity: 1; }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { width: 5px; margin-left: .4rem; }
@media (min-width: 720px) { .nav-links { display: flex; } }

.cart-toggle {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  transition: border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.cart-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: clip;
}
.hero-bg {
  position: absolute; inset: -6% 0;
  width: 100%; height: 112%;
  object-fit: cover; object-position: 62% 38%;
  transform: translate3d(0,0,0) scale(1.14);
  transform-origin: center;
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    /* soft cream halo right behind the text block, bottom-left */
    radial-gradient(ellipse 75% 65% at 8% 100%, rgba(244,241,231,0.75), transparent 68%),
    /* primary reading scrim: solid where the copy lives, fading toward the product */
    linear-gradient(90deg, rgba(244,241,231,0.97) 0%, rgba(244,241,231,0.93) 34%, rgba(244,241,231,0.55) 56%, rgba(244,241,231,0.08) 78%),
    /* gentle top-down lift so the kicker never sits on a bright sky/wall patch */
    linear-gradient(180deg, rgba(244,241,231,0.35) 0%, rgba(244,241,231,0) 30%, rgba(244,241,231,0) 62%, rgba(244,241,231,0.5) 100%);
}
.hero-content {
  position: relative;
  padding-block: 6rem 4.5rem;
  max-width: 640px;
}
.hero .kicker {
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.78rem; color: var(--ink-soft);
  margin-bottom: 1.1rem;
  text-shadow: 0 1px 16px var(--bg);
}
.hero-title {
  font-size: clamp(2.4rem, 6.4vw, 4.4rem);
  line-height: 0.98;
  color: var(--ink);
  max-width: 14ch;
  margin-bottom: 1.3rem;
  text-shadow: 0 2px 24px var(--bg), 0 1px 2px rgba(244,241,231,0.6);
}
.hero-sub {
  font-size: 1.08rem;
  color: var(--ink-soft);
  text-shadow: 0 1px 20px var(--bg);
  max-width: 42ch;
  margin-bottom: 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* =============================================================
   7. About
   ============================================================= */
.about { padding-block: 6.5rem 4rem; }
.about-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.about-lead h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-top: 0.6rem; }
.about-copy p { font-size: 1.05rem; color: var(--ink-soft); max-width: 46ch; }
@media (min-width: 960px) {
  .about-grid { grid-template-columns: 1fr 1fr; align-items: end; }
}

.pillars {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.6rem;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s var(--ease-out);
}
.pillar:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -28px rgba(36,26,23,0.35);
  border-color: var(--line-strong);
}
.pillar-num {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}
.pillar h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.pillar p { color: var(--ink-mute); font-size: 0.95rem; }

/* =============================================================
   8. Shop / product grid
   ============================================================= */
.shop { padding-block: 3rem 6rem; }
.shop-head { max-width: 46ch; margin-bottom: 3rem; }
.shop-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 0.7rem; }
.shop-head p { color: var(--ink-mute); }

.product-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 540px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 50px -30px rgba(36,26,23,0.4);
}
.product-media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-2);
}
.product-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease-out), filter .6s var(--ease-out);
}
.product-card:hover .product-media img { transform: scale(1.08); filter: saturate(1.1); }
.product-info { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.product-cat {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent);
}
.product-name button {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  transition: color .3s var(--ease-out);
}
.product-name button:hover { color: var(--accent); }
.product-desc { color: var(--ink-mute); font-size: 0.9rem; flex: 1; }
.product-foot {
  margin-top: 0.6rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.product-price { font-weight: 700; font-size: 1.05rem; }

/* =============================================================
   9. Shipping note — intentionally low-key, no section-num badge
   ============================================================= */
.shipping { padding-block: 0.5rem; }
.shipping-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 640px;
  margin-inline: auto;
  padding: 1.6rem 1.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.shipping-icon { flex-shrink: 0; margin-top: 0.15rem; color: var(--ink-mute); }
.shipping-text h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.shipping-text p { font-size: 0.86rem; color: var(--ink-mute); line-height: 1.55; }

/* =============================================================
   10. CTA
   ============================================================= */
.cta { padding-block: 2rem 7rem; }
.cta-inner {
  background: var(--ink);
  color: var(--bg);
  border-radius: 28px;
  padding: 4rem 2rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.cta-inner .section-num { color: var(--bg); border-color: rgba(244,241,231,0.3); }
.cta-inner h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); max-width: 16ch; margin: 0.8rem 0 0.7rem; }
.cta-inner p { color: rgba(244,241,231,0.75); margin-bottom: 2rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }
.cta-inner .btn-ghost { border-color: rgba(244,241,231,0.35); color: var(--bg); }
.cta-inner .btn-ghost:hover { border-color: var(--bg); color: var(--bg); }

/* =============================================================
   10. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--line); padding-block: 3rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.7rem; }
.footer-logo { height: 43px; width: auto; opacity: 0.92; }
.footer-tagline { color: var(--ink-mute); font-size: 0.92rem; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; font-weight: 500; }
.footer-links a { transition: color .3s var(--ease-out); }
.footer-links a:hover { color: var(--accent); }
.footer-credits { color: var(--ink-mute); font-size: 0.8rem; margin-top: 1rem; }

/* =============================================================
   11. Cart drawer
   ============================================================= */
.cart-scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(36,26,23,0.45);
  opacity: 0; transition: opacity .35s var(--ease-out);
}
.cart-scrim.is-open { opacity: 1; }

.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 80;
  height: 100dvh; width: min(420px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .45s var(--ease-out);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-size: 1.3rem; }
.cart-close {
  width: 38px; height: 38px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
}
.cart-close:hover { border-color: var(--accent); color: var(--accent); }

.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-empty { color: var(--ink-mute); padding-block: 2rem; text-align: center; }

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.9rem;
  align-items: center;
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.cart-item-price { color: var(--ink-mute); font-size: 0.85rem; }
.cart-item-qty { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; line-height: 1;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-item-remove {
  justify-self: end;
  color: var(--ink-mute);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cart-item-remove:hover { color: var(--accent); }

.cart-summary { border-top: 1px solid var(--line); padding: 1.2rem 1.4rem 1.6rem; }
.cart-total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 1.1rem; margin-bottom: 0.6rem;
}
.cart-note { font-size: 0.78rem; color: var(--ink-mute); margin-bottom: 1rem; }

/* =============================================================
   12. Product modal
   ============================================================= */
.product-modal {
  border: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  /* Mobile default: full-screen sheet, no floating card */
  inset: 0;
  margin: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}
@media (min-width: 720px) {
  .product-modal {
    inset: auto;
    margin: auto;
    width: min(920px, 92vw);
    max-width: 92vw;
    height: auto;
    max-height: 88vh;
    border-radius: 24px;
  }
}
.product-modal::backdrop { background: rgba(36,26,23,0.55); }
.modal-close {
  position: absolute; z-index: 5;
  top: calc(0.8rem + env(safe-area-inset-top, 0px));
  right: calc(0.8rem + env(safe-area-inset-right, 0px));
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -10px rgba(36,26,23,0.4);
}
.modal-close:hover { color: var(--accent); }
.modal-body {
  display: grid; grid-template-columns: 1fr;
  height: 100%; max-height: 100%;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
/* Grid items default to a content-based minimum width, so a wide row of
   thumbnails (or any long line) can force the whole column wider than the
   screen. min-width: 0 lets each column shrink to the track's real size,
   pushing the overflow into .modal-thumbs' own scrollbar instead. */
.modal-gallery, .modal-info { min-width: 0; }
@media (min-width: 720px) {
  .modal-body { height: auto; max-height: 88vh; }
}
@media (min-width: 800px) {
  .modal-body { grid-template-columns: 1.1fr 1fr; }
}

.modal-gallery-main {
  height: 38dvh;
  background: var(--bg-2);
  overflow: hidden;
  flex-shrink: 0;
}
.modal-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 720px) {
  .modal-gallery-main { height: auto; aspect-ratio: 1 / 1; }
}
.modal-thumbs { display: flex; gap: 0.5rem; padding: 0.8rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.modal-thumbs button {
  flex: 0 0 auto;
  width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: opacity .25s var(--ease-out), border-color .25s var(--ease-out);
}
.modal-thumbs button.is-active { opacity: 1; border-color: var(--accent); }
.modal-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.modal-info { padding: 1.4rem 1.4rem 0.4rem; }
.modal-info .product-cat { display: block; margin-bottom: 0.5rem; }
.modal-info h2 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.modal-info .modal-desc { color: var(--ink-soft); margin-bottom: 1rem; }
.modal-meta { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
.modal-meta li { font-size: 0.85rem; color: var(--ink-mute); }
.modal-meta li.meta-row { display: flex; align-items: center; gap: 0.4rem; }
.meta-icon { flex-shrink: 0; color: var(--accent); }
.modal-meta strong { color: var(--ink); font-weight: 600; }
.modal-price { font-size: 1.4rem; font-weight: 700; margin-bottom: 0; display: block; }
.modal-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  position: sticky; bottom: 0;
  margin: 1.1rem -1.4rem 0;
  padding: 0.9rem 1.4rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.modal-qty { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.6rem; }
.modal-qty span { min-width: 1.4rem; text-align: center; font-weight: 600; }
@media (min-width: 720px) {
  .modal-info { padding: 1.8rem 1.8rem 2rem; }
  .modal-info h2 { font-size: 1.8rem; }
  .modal-price { font-size: 1.5rem; margin-bottom: 1.2rem; }
  .modal-actions {
    position: static;
    margin: 0; padding: 0;
    border-top: 0;
    background: none;
  }
}

/* =============================================================
   13. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-bg { transform: none !important; }
}

/* =============================================================
   14. Breakpoints already applied inline above.
   ============================================================= */
@media (min-width: 1600px) {
  .hero-title { font-size: 4.9rem; }
}
