/* ==========================================================================
   Actual — shared styles (tokens, base, layout shell, shared components)
   Page-specific styles live in home.css, pages.css and catalog.css.
   Fonts: css/fonts.css registers "Actual Display" (headings) and "Actual Sans" (body).
   ========================================================================== */

:root {
  /* Brand palette (Brandbook 2025) */
  --berry: #940435;       /* Warm Berry — primario */
  --olive: #807B2D;       /* Olive — primario */
  --ochre: #998011;       /* Golden Ochre — primario */
  --sage: #6D8556;        /* Sage — primario */
  --moss: #5F5C3D;        /* Dark Moss — secundario */
  --ivory: #FDECD6;       /* Ivory — secundario */

  /* Derived tints for UI & accessible text */
  --berry-deep: #75022a;
  --olive-ink: #666222;   /* olive dark enough for small text on ivory (5.4:1) */
  --ink: #36341f;         /* body text */
  --ink-soft: #5F5C3D;    /* secondary text (5.9:1 on ivory) */
  --cream: #FFF7EC;       /* raised surfaces */
  --sand: #F6DFC2;        /* sunken surfaces */
  --line: rgba(95, 92, 61, 0.2);
  --line-strong: rgba(95, 92, 61, 0.38);

  /* Type */
  --font-display: "Actual Display", "Cormorant Garamond", "Didot", Georgia, serif;
  --font-sans: "Actual Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Shape & depth */
  --radius-s: 10px;
  --radius: 18px;
  --radius-l: 28px;
  --radius-pill: 999px;
  --shadow-s: 0 1px 2px rgba(54, 52, 31, 0.08);
  --shadow: 0 1px 2px rgba(54, 52, 31, 0.06), 0 14px 30px -18px rgba(54, 52, 31, 0.45);

  /* Layout */
  --container: 1240px;
  --gutter: clamp(16px, 4.5vw, 40px);
  --header-h: 64px;
  --section-space: clamp(56px, 10vw, 112px);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Paper grain (softened copy of the brandbook texture), multiplied over ivory surfaces */
  --paper: url("../assets/img/brand/paper-soft.webp");
}

@media (min-width: 960px) {
  :root { --header-h: 76px; }
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ivory);
  background-image: var(--paper);
  background-size: 512px;
  background-blend-mode: multiply;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.08; }
p, ul, ol, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

::selection { background: var(--berry); color: var(--ivory); }

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--berry);
  color: var(--ivory);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

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

@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;
  }
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.display-1,
.display-2,
.display-3 {
  font-family: var(--font-display);
  font-weight: 300; /* Noto Serif Display 300 ≈ Bon Vivant Regular */
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.display-1 { font-size: clamp(2.75rem, 11vw, 6.25rem); line-height: 0.98; }
.display-2 { font-size: clamp(2.25rem, 7.5vw, 4rem); line-height: 1.02; }
.display-3 { font-size: clamp(1.6rem, 5vw, 2.4rem); line-height: 1.08; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--olive-ink);
}

.lead {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.prose p + p { margin-top: 1em; }
.prose { max-width: 62ch; text-wrap: pretty; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-space); }
.section--tight { padding-block: calc(var(--section-space) * 0.6); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(24px, 5vw, 40px);
}
.section-head__text { display: grid; gap: 10px; max-width: 640px; }

/* Signature catalog rule: olive line with a berry segment in the middle */
.brand-rule {
  height: 4px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, var(--olive) 0 38%, var(--berry) 38% 62%, var(--olive) 62% 100%);
}

/* --------------------------------------------------------------------------
   Buttons & links
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--berry);
  --btn-fg: var(--ivory);
  --btn-border: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { --btn-bg: var(--berry-deep); }
.btn:active { transform: translateY(1px); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: var(--line-strong); }
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--ivory); --btn-border: var(--ink); }

.btn--light { --btn-bg: var(--ivory); --btn-fg: var(--berry); --btn-border: var(--ivory); }
.btn--light:hover { --btn-bg: var(--cream); --btn-fg: var(--berry-deep); }

.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--ivory); --btn-border: rgba(253, 236, 214, 0.6); }
.btn--outline-light:hover { --btn-bg: var(--ivory); --btn-fg: var(--moss); --btn-border: var(--ivory); }

.btn--block { width: 100%; }
.btn--lg { min-height: 56px; padding-inline: 28px; font-size: 1rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--berry);
  text-decoration: none;
}
.link-arrow svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(95, 92, 61, 0.1); color: var(--berry); }

/* --------------------------------------------------------------------------
   Brand marks (SVGs recolored via CSS masks)
   -------------------------------------------------------------------------- */
.mark {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
/* Ratios = the SVG viewBoxes (1000×228.7, 1000×336.2, 1000×896.3, 1000×235.3) */
.mark--wordmark { --mark: url("../assets/img/brand/wordmark.svg"); aspect-ratio: 1000 / 228.7; }
.mark--logo { --mark: url("../assets/img/brand/logo.svg"); aspect-ratio: 1000 / 336.2; }
.mark--isotipo { --mark: url("../assets/img/brand/isotipo.svg"); aspect-ratio: 1000 / 896.3; }
.mark--signature { --mark: url("../assets/img/brand/signature.svg"); aspect-ratio: 1000 / 235.3; }

/* Circle icon badges (as in the brandbook's Instagram highlights) */
.icon-badge {
  --badge-bg: var(--berry);
  --badge-fg: var(--ivory);
  --size: 72px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--badge-bg);
  color: var(--badge-fg);
}
.icon-badge .icon { width: 48%; height: 58%; }
.icon {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.icon-badge--berry { --badge-bg: var(--berry); --badge-fg: var(--ivory); }
.icon-badge--olive { --badge-bg: var(--olive); --badge-fg: var(--ivory); }
.icon-badge--ochre { --badge-bg: var(--ochre); --badge-fg: var(--ivory); }
.icon-badge--sage { --badge-bg: var(--sage); --badge-fg: var(--ivory); }
.icon-badge--moss { --badge-bg: var(--moss); --badge-fg: var(--ivory); }
.icon-badge--ivory { --badge-bg: var(--ivory); --badge-fg: var(--moss); box-shadow: inset 0 0 0 1px var(--line); }

/* Brand pattern surface */
.pattern {
  background-color: var(--ochre);
  background-image: url("../assets/img/brand/pattern.webp");
  background-size: 420px;
  background-repeat: repeat;
}

/* --------------------------------------------------------------------------
   Announcement bar + header
   -------------------------------------------------------------------------- */
.announce {
  background: var(--berry);
  color: var(--ivory);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: center;
}
.announce p { padding: 8px var(--gutter); }
.announce a { color: inherit; font-weight: 600; }
.announce__more { display: none; }
@media (min-width: 480px) { .announce__more { display: inline; } }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Solid (no backdrop-filter): a filter would become the containing block of the fixed mobile drawer */
  background: var(--ivory) var(--paper) 0 0 / 512px;
  background-blend-mode: multiply;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -20px rgba(54, 52, 31, 0.6); }

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  gap: 8px;
}

.brand {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  color: var(--berry);
  text-decoration: none;
  justify-self: center;
}
.brand .mark--wordmark { width: 108px; }

.nav-toggle {
  grid-column: 1;
  justify-self: start;
  margin-left: -10px;
}
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-menu { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }

.site-header__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: -10px;
}

/* Mobile drawer */
.site-nav {
  position: fixed;
  inset: var(--nav-top, var(--header-h)) 0 0 0; /* --nav-top set by main.js to the header's bottom edge */
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: var(--ivory) var(--paper) 0 0 / 512px;
  background-blend-mode: multiply;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.nav-open .site-nav {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
}
.nav-open { overflow: hidden; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; }
.site-nav li + li { border-top: 1px solid var(--line); }
.site-nav ul a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  text-decoration: none;
  color: var(--ink);
}
.site-nav ul a[aria-current="page"] { color: var(--berry); }
.site-nav__extra {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  gap: 12px;
}
.site-nav__extra p { font-size: 0.9rem; color: var(--ink-soft); }

@media (min-width: 960px) {
  .site-header__inner { grid-template-columns: auto 1fr auto; gap: 32px; }
  .brand { grid-column: 1; justify-self: start; }
  .brand .mark--wordmark { width: 128px; }
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    grid-column: 2;
    justify-self: center;
    flex-direction: row;
    padding: 0;
    background: none;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .site-nav ul { display: flex; gap: 4px; }
  .site-nav li + li { border-top: 0; }
  .site-nav ul a {
    position: relative;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .site-nav ul a svg { display: none; }
  .site-nav ul a::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 2px;
    background: var(--berry);
    transform: scaleX(0);
    transition: transform 0.25s var(--ease);
  }
  .site-nav ul a:hover::after,
  .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
  .site-nav__extra { display: none; }
}

/* --------------------------------------------------------------------------
   Product card (shared: home, catálogo, relacionados)
   -------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; } }

.card { position: relative; min-width: 0; }
.card__link { display: grid; gap: 12px; color: inherit; text-decoration: none; }

.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sand);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card__link:hover .card__media img { transform: scale(1.04); }
.card__placeholder { position: absolute; inset: 0; display: grid; place-items: center; }
.card--sold .card__media img { filter: saturate(0.6); opacity: 0.85; }

.card__body { display: grid; gap: 4px; padding-inline: 2px; }
.card__name {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--olive-ink);
  overflow-wrap: anywhere;
}
/* Prices in the sans (as printed in the catalog PDF): the display serif draws "$" with a hairline that reads as "S" */
.card__price {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--ink);
}
.card__price.card__price--ask {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--berry);
}
@media (min-width: 640px) {
  .card__name { font-size: 0.78rem; }
  .card__price { font-size: 1.15rem; }
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}
.badge--new { background: var(--berry); color: var(--ivory); }
.badge--sold { background: var(--ivory); color: var(--berry); box-shadow: inset 0 0 0 1.5px var(--berry); }

/* Chips (filters, tags) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"],
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--ivory); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--moss);
  color: var(--ivory);
}
.site-footer__band { height: 56px; background-size: 503px; } /* 503px → exactly one pattern row per 56px */
.site-footer__inner {
  display: grid;
  gap: 40px;
  padding-block: 56px 32px;
}
.site-footer .mark--logo { width: 150px; color: var(--ivory); }
.site-footer__tagline {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.15;
  max-width: 16ch;
}
.site-footer__cols { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer h2 {
  margin-bottom: 14px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(253, 236, 214, 0.7);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.7; }
.site-footer__social { display: flex; gap: 8px; margin-top: 4px; }
.site-footer__social .icon-btn { color: var(--ivory); border: 1px solid rgba(253, 236, 214, 0.35); }
.site-footer__social .icon-btn:hover { background: var(--ivory); color: var(--moss); }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(253, 236, 214, 0.2);
  font-size: 0.8rem;
  color: rgba(253, 236, 214, 0.75);
  padding-right: 76px; /* keep the last line clear of the floating WhatsApp button */
}
@media (min-width: 800px) {
  .site-footer__inner { grid-template-columns: 1.1fr 2fr; }
  .site-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__legal { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Floating WhatsApp button
   -------------------------------------------------------------------------- */
.wa-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--berry);
  color: var(--ivory);
  box-shadow: 0 0 0 2px var(--ivory), 0 10px 28px -10px rgba(117, 2, 42, 0.8); /* ivory ring: visible on berry sections */
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.wa-fab svg { width: 28px; height: 28px; }
.wa-fab:hover { background: var(--berry-deep); transform: translateY(-2px); }
.nav-open .wa-fab { display: none; }

/* --------------------------------------------------------------------------
   States
   -------------------------------------------------------------------------- */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 56px 16px;
  text-align: center;
  color: var(--ink-soft);
}
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--sand) 30%, var(--cream) 50%, var(--sand) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }
