/* Isale Atelier - catalog site styles.
   Palette comes from the brand logo and reference (see campana/assets/palette.json).
   Text/background pairs used here were checked for WCAG AA (>= 4.5:1 for body text). */

:root {
  --sage: #B7BB7A;
  --sage-dark: #7C8348;
  --sage-deep: #5E6538;
  --cream: #F5EBDC;
  --cream-light: #FBF5EA;
  --cream-dark: #E7D8C1;
  --pink: #F297A0;
  --pink-dark: #C9636F;
  --pink-deep: #AC4756;
  --blush: #F9D0CE;
  --ink: #3F4230;
  --thread: #C7AAA3;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 24px;
  --shadow: 0 1px 0 rgba(63, 66, 48, 0.04), 0 14px 32px -18px rgba(63, 66, 48, 0.4);
  --gutter: 16px;

  /* Subtle paper grain (inline SVG noise, tiles seamlessly). */
  --paper: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .32 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
  /* The hero blobs stick out of the page on purpose. `hidden` is the fallback for browsers
     without `clip` (Safari 15 and older); on the root element both only crop the sideways overflow. */
  overflow-x: hidden;
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  background-color: var(--cream);
  background-image: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}
p { margin: 0; }

.container { width: min(100% - (var(--gutter) * 2), 1180px); margin-inline: auto; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Visible focus for every interactive element */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 0.75rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: var(--cream-light); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin-bottom: 0.7rem;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pink-deep);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.7rem 1.4rem;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 1rem/1.15 var(--font-body); text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--pink); color: var(--ink); }
.btn--primary:hover { background: var(--ink); color: var(--cream-light); }
.btn--wa { background: var(--sage-deep); color: var(--cream-light); }
.btn--wa:hover { background: var(--ink); color: var(--cream-light); }
.btn--small { min-height: 42px; padding: 0.45rem 1rem; font-size: 0.9375rem; }
/* A WhatsApp button whose number is not configured: shown, but it has no link. */
.btn.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* Development-only notice (js/app.js shows it on file: and localhost pages, never on the published site). */
.dev-banner {
  padding: 0.6rem var(--gutter);
  background: var(--ink); color: var(--cream-light);
  font-size: 0.9rem; font-weight: 700; line-height: 1.4; text-align: center;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245, 235, 220, 0.94);
  border-bottom: 1px solid rgba(124, 131, 72, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 72px; padding-block: 6px;
}
/* flex: none keeps the logo from being squeezed by the nav; the width grows with the screen (88px to 132px). */
.brand { display: block; flex: none; line-height: 0; border-radius: 12px; }
.brand img { width: clamp(88px, 26vw, 132px); height: auto; }
.site-nav { display: flex; align-items: center; gap: 0.35rem 1.2rem; }
.site-nav__link {
  padding: 0.5rem 0.2rem; font-weight: 700; font-size: 0.95rem;
  color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent;
}
.site-nav__link:hover { border-bottom-color: var(--pink-dark); }
.site-nav__link--optional { display: none; }
/* On the narrowest phones the header keeps only the logo and the WhatsApp button
   (the hero has its own "Ver catálogo" button). */
@media (max-width: 399px) { .site-nav__link--catalog { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow-x: clip; padding-block: 28px 56px; }
.hero__inner { display: grid; gap: 40px; align-items: center; }
.hero__copy { max-width: 36rem; }
.hero h1 {
  font-size: clamp(2.5rem, 9.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; font-weight: 500; color: var(--pink-deep); white-space: nowrap; }
.hero__lead { margin-top: 1.2rem; font-size: 1.15rem; max-width: 30rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

.hero-art {
  position: relative; width: min(100%, 520px); margin-inline: auto;
  aspect-ratio: 1 / 1.08;
}
.hero-art__blob { position: absolute; z-index: 0; }
.hero-art__blob--sage { width: 96%; right: -14%; top: -6%; fill: var(--sage); opacity: 0.55; }
.hero-art__blob--blush { width: 70%; left: -14%; bottom: -8%; fill: var(--blush); }
.hero-art__photo {
  position: absolute; z-index: 1; margin: 0; overflow: hidden;
  background: var(--cream-light);
  border: 6px solid var(--cream-light);
  box-shadow: var(--shadow);
}
.hero-art__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-art__photo--a {
  left: 2%; top: 3%; width: 60%; aspect-ratio: 4 / 5;
  border-radius: 999px 999px 26px 26px;
}
.hero-art__photo--b {
  right: 0; top: 22%; width: 36%; aspect-ratio: 3 / 4;
  border-radius: 999px 999px 22px 22px; z-index: 2;
}
.hero-art__photo--c {
  right: 8%; bottom: 1%; width: 38%; aspect-ratio: 1; border-radius: 50%; z-index: 3;
}
.hero-art__photo--c img { object-position: 50% 62%; }
.hero-art__thread {
  position: absolute; z-index: 2; left: 4%; bottom: 3%; width: 46%;
  stroke: var(--pink-dark); opacity: 0.85;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 9vw, 104px); }
.section__head { max-width: 40rem; margin-bottom: 1.6rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.section h2 { font-size: clamp(2rem, 6vw, 3rem); }
.section__lead { margin-top: 0.9rem; }

/* ---------- Catalog ---------- */
.catalog { padding-top: clamp(32px, 5vw, 56px); }
.filters { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  min-height: 44px; padding: 0.5rem 0.85rem;
  border: 2px solid var(--sage-dark); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: 700 0.875rem/1.1 var(--font-body); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { background: var(--cream-light); }
.chip[aria-pressed="true"] { background: var(--sage-deep); border-color: var(--sage-deep); color: var(--cream-light); }
.filters__count { margin: 0.6rem 0 1rem; font-size: 0.875rem; }
@media (min-width: 720px) {
  .filters { gap: 0.6rem; }
  .chip { padding: 0.5rem 1.15rem; font-size: 0.95rem; }
  .filters__count { margin: 0.9rem 0 1.4rem; font-size: 0.95rem; }
}

/* Masonry-style grid: every photo keeps its own proportions (nothing is cropped).
   Without JavaScript help this is a plain grid; js/app.js adds .is-masonry and sets
   each card's row span so cards stack into the shortest column. */
.grid { --card-gap: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--card-gap) 10px; align-items: start; }
@media (min-width: 720px) { .grid { --card-gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 20px; } }
@media (min-width: 1100px) { .grid { --card-gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 24px; } }
.grid.is-masonry { grid-auto-rows: 4px; row-gap: 0; }

.card {
  display: block; width: 100%; min-width: 0;
  margin: 0;
  overflow: hidden;
  container: card / inline-size; /* lets the button label adapt to the card's own width */
  background: var(--cream-light); border-radius: 16px; box-shadow: var(--shadow);
  animation: card-in 0.4s ease both;
}
.card[hidden] { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card__photo {
  position: relative; display: block; width: 100%; margin: 0; padding: 0;
  border: 0; background: var(--blush); cursor: zoom-in; overflow: hidden;
}
.card__photo img { width: 100%; height: auto; transition: transform 0.5s ease; }
.card__photo:hover img { transform: scale(1.03); }
/* Compact by default (phones show two cards side by side); roomier from 720px up. */
.card__zoom {
  position: absolute; right: 8px; bottom: 8px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream-light); color: var(--ink);
  box-shadow: 0 4px 12px -4px rgba(63, 66, 48, 0.45);
}
.card__zoom .icon { width: 18px; height: 18px; }
/* Two-tone focus ring (dark outer line + light inner line) so it stays visible on dark and light photos. */
.card__photo:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.card__photo:focus-visible::after {
  content: ""; position: absolute; inset: 3px; z-index: 1;
  border: 3px solid var(--cream-light); pointer-events: none;
}

.card__body { padding: 0.65rem 0.7rem 0.75rem; }
.card__eyebrow {
  display: none;
  margin-bottom: 0.3rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--pink-deep);
}
.card__name { font-size: 1rem; line-height: 1.15; }
.card__tag {
  display: inline-block; margin-top: 0.4rem; padding: 0.15rem 0.5rem;
  border-radius: 12px; background: var(--blush); color: var(--ink);
  font-size: 0.7rem; font-weight: 700; line-height: 1.3;
}
/* Phone text sizes never go below 13px for descriptions and 12px for the currency mark. */
.card__desc { margin-top: 0.3rem; font-size: 0.8125rem; line-height: 1.4; }
.card__price {
  margin-top: 0.5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1;
}
.card__price small { font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; }
.card__price--ask { font-family: var(--font-body); font-size: 0.875rem; font-weight: 700; color: var(--sage-deep); }
.card__cta {
  width: 100%; margin-top: 0.55rem; min-height: 40px;
  padding: 0.35rem 0.4rem; gap: 0.3rem; font-size: 0.8rem; line-height: 1.1; text-align: center;
}
.card__cta .icon { width: 16px; height: 16px; flex: none; }
/* Phones show just "Pedir" + the WhatsApp icon; the full label returns from 720px up, but only
   when the card itself is wide enough to fit it on one line (see the container query below).
   The link's aria-label always carries the full text for screen readers. */
.card__cta-more { display: none; }

@media (min-width: 720px) {
  .card__cta-more { display: inline; }
  .card { border-radius: var(--radius); }
  .card__zoom { right: 12px; bottom: 12px; width: 40px; height: 40px; }
  .card__zoom .icon { width: 22px; height: 22px; }
  .card__body { padding: 1rem 1.15rem 1.25rem; }
  .card__eyebrow { display: block; }
  .card__name { font-size: 1.35rem; }
  .card__tag { margin-top: 0.5rem; padding: 0.2rem 0.7rem; font-size: 0.8rem; }
  .card__desc { margin-top: 0.5rem; font-size: 0.975rem; line-height: 1.5; }
  .card__price { margin-top: 0.9rem; font-size: 1.6rem; }
  .card__price small { font-size: 0.85rem; }
  .card__price--ask { font-size: 1rem; }
  .card__cta { margin-top: 0.85rem; min-height: 48px; padding: 0.5rem 1rem; gap: 0.6rem; font-size: 1rem; }
  .card__cta .icon { width: 20px; height: 20px; }
}

/* "Pedir por WhatsApp" needs roughly 270px of card width. In the 3- and 4-column grids some cards are
   narrower, so they keep just "Pedir" instead of wrapping onto two lines. (Browsers without container
   queries simply keep the long label.) */
@container card (max-width: 269px) {
  .card__cta-more { display: none; }
}

/* ---------- How to order ---------- */
.how { position: relative; margin-top: 56px; background: var(--blush); }
/* pink-deep text is only 3.9:1 on blush, so use ink for text that sits on the blush band */
.how .eyebrow { color: var(--ink); }
.wave { position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); display: block; width: 100%; height: 44px; fill: var(--blush); }
.wave--sage { fill: var(--sage); }
.steps {
  display: grid; gap: 18px; margin: 2rem 0 0; padding: 0; list-style: none;
  counter-reset: none;
}
.step {
  position: relative; padding: 1.5rem 1.4rem 1.6rem;
  background: var(--cream-light); border-radius: var(--radius); box-shadow: var(--shadow);
}
.step__num {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 0.9rem;
  border-radius: 50%; background: var(--pink); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.4rem;
}
.step h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.how__cta { display: flex; justify-content: center; margin-top: 2rem; }

/* ---------- Footer ---------- */
/* No margin above the footer: its wave sits on the bottom edge of the blush band, so the two join without a cream strip. */
.site-footer {
  position: relative; margin-top: 0; padding: 56px 0 112px;
  background: var(--sage); color: var(--ink);
}
.site-footer__inner { display: grid; gap: 28px; }
.site-footer__brand img { margin-bottom: 0.6rem; }
.site-footer__name { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; }
.site-footer__copy { margin-top: 0.3rem; font-size: 0.9rem; }
.site-footer__links { display: grid; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer__links a {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px;
  font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
}
.site-footer__links a:hover { text-decoration-thickness: 3px; }

/* ---------- Floating WhatsApp button ---------- */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--sage-deep); color: var(--cream-light);
  box-shadow: 0 10px 24px -8px rgba(63, 66, 48, 0.6);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.wa-float:hover { background: var(--ink); transform: translateY(-2px); }
.wa-float .icon { width: 30px; height: 30px; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--cream-light);
}
/* Nearly opaque so the page behind (card text, header, floating button) cannot ghost through the caption. */
.lightbox::backdrop { background: rgba(44, 46, 33, 0.985); }
/* Hidden while the next photo loads, so the previous product's photo never sits under the new name and price. */
.lightbox__img.is-loading { visibility: hidden; }
.lightbox__inner {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  width: 100%; height: 100%; padding: 60px 12px 14px;
}
.lightbox :focus-visible { outline-color: var(--cream-light); }
.lightbox__close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 2px solid var(--cream-light); border-radius: 50%;
  background: var(--ink); color: var(--cream-light); cursor: pointer;
}
.lightbox__close:hover { background: var(--cream-light); color: var(--ink); }
.lightbox__stage {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}
.lightbox__figure { position: relative; min-height: 0; height: 100%; margin: 0; }
.lightbox__img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 14px;
}
.lightbox__nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 2px solid var(--cream-light); border-radius: 50%;
  background: rgba(44, 46, 33, 0.72); color: var(--cream-light); cursor: pointer;
}
.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }
.lightbox__nav:hover { background: var(--cream-light); color: var(--ink); }
.lightbox[data-single] .lightbox__nav { visibility: hidden; }
.lightbox__caption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  width: min(100%, 720px); margin: 14px auto 0;
}
.lightbox__title { font-size: 1.4rem; color: var(--cream-light); }
.lightbox__price { margin-top: 0.2rem; font-weight: 700; }
.lightbox__count {
  margin-top: 0.2rem; font-size: 0.875rem;
  /* Visually hidden on phones to save vertical space; still announced to screen readers. */
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* ---------- Larger screens ---------- */
@media (min-width: 520px) {
  .site-nav__link--optional { display: inline-block; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .lightbox__nav { width: 52px; height: 52px; }
  .lightbox__count { position: static; width: auto; height: auto; margin: 0.2rem 0 0; overflow: visible; clip: auto; white-space: normal; }
}

@media (min-width: 900px) {
  :root { --gutter: 24px; }
  .hero { padding-block: 48px 48px; }
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; gap: 56px; }
  .site-footer__inner { grid-template-columns: 1fr auto; align-items: end; }
  .lightbox__inner { padding-top: 64px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .wa-float:hover, .card__photo:hover img { transform: none; }
}

@media print {
  .site-header, .wa-float, .filters, .lightbox { display: none; }
}
