/* Central Hortofrutícola · Sodepal
   Tema claro fijo: el listado de Drive (iframe de Google) es blanco y los logos
   institucionales están pensados para fondo claro.
   Radios: contenedores e imágenes 20px / 14px, botones en píldora, botones de icono circulares. */

/* ---------- Fuentes (autoalojadas) ---------- */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* Marca (muestreados del logotipo) */
  --green: #53924c;        /* verde del logo: solo texto grande y elementos gráficos */
  --green-ink: #3a7335;    /* verde accesible para texto y botones (5,7:1 sobre blanco) */
  --green-deep: #24461f;
  --brown: #3f2d1e;        /* marrón de "CENTRAL / SODEPAL SAU" */

  /* Neutros */
  --bg: #fbfbf9;
  --surface: #ffffff;      /* mismo blanco que el iframe de Google */
  --tint: #eef2eb;
  --ink: #1f2420;
  --ink-soft: #4a524b;
  --line: #dde3d9;

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  /* Margen lateral: el texto del hero y el de la página comparten borde izquierdo */
  --gutter: clamp(30px, 5vw, 64px);
  --frame: clamp(10px, 1.6vw, 20px);
  --header-h: 88px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --scrim: 14 26 16;       /* verde casi negro del velo del vídeo (canales RGB) */
  --brand-wash: #e3ebdf;   /* verde lavado para el símbolo del logotipo como fondo */
  --green-soft: #a9cf9f;   /* verde claro para detalles sobre el verde oscuro */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Ángulo animable para dibujar el símbolo del logotipo */
@property --sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

@media (min-width: 768px) {
  :root { --header-h: 112px; }
}

/* Móvil en horizontal: cabecera compacta para que el hero quepa */
@media (max-height: 540px) and (orientation: landscape) {
  :root { --header-h: 72px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: #c3d3bd var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }

a {
  color: var(--green-ink);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
a:not([class]):hover { color: var(--green-deep); text-decoration-color: currentColor; }

::selection { background: #cfe3c9; color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--green-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: currentColor;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--green-ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

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

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.4em;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent; /* conserva la forma en modo de alto contraste */
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 120ms ease-out;
}
.btn .icon { transition: transform 0.35s var(--ease-out); }
.btn:active { transform: scale(0.97); }

.btn-light {
  background: var(--bg);
  color: var(--green-ink);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover .icon { transform: translateY(2px); }
  .btn-light:hover { color: var(--green-deep); box-shadow: 0 0 0 4px rgb(255 255 255 / 0.28); }
}

/* ---------- Cabecera ---------- */
.site-header {
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: block;
  height: calc(var(--header-h) - 18px);
  flex: none;
}
.brand img {
  height: 100%;
  width: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 12px);
  list-style: none;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: clamp(10px, 1.6vw, 16px);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color 200ms ease, color 200ms ease, transform 120ms ease-out;
}

.site-nav .nav-cta {
  background: var(--green-ink);
  color: #fff;
}
.site-nav .nav-cta:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .site-nav a:not(.nav-cta):hover { background: var(--tint); color: var(--green-deep); }
  .site-nav .nav-cta:hover { background: var(--green-deep); color: #fff; }
}

@media (min-width: 768px) {
  .site-nav a { font-size: 1.125rem; }
}

/* Pantallas muy estrechas (320px): solo el acceso a precios */
@media (max-width: 359px) {
  .header-inner { gap: 12px; }
  .site-nav li:not(:first-child) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding-inline: var(--frame);
}

.hero-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--green-deep);
  display: grid;
  align-content: end;
  /* Deja asomar el bloque de precios por debajo */
  min-height: clamp(320px, calc(100vh - var(--header-h) - var(--frame) - 64px), 900px);
  min-height: clamp(320px, calc(100svh - var(--header-h) - var(--frame) - 64px), 900px);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Velo para leer el texto sobre el vídeo */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(var(--scrim) / 0.82) 0%, rgb(var(--scrim) / 0.45) 38%, rgb(var(--scrim) / 0) 68%),
    linear-gradient(to right, rgb(var(--scrim) / 0.35) 0%, rgb(var(--scrim) / 0) 55%);
}

/* El texto y el botón de pausa se alinean con la retícula de .container */
.hero-frame {
  --hero-pad: clamp(22px, 5vw, 64px);
  --hero-edge: max(calc(var(--gutter) - var(--frame)), calc((100% - 1280px) / 2 + var(--gutter)));
}

.hero-content {
  position: relative;
  padding: var(--hero-pad) var(--hero-edge);
  color: #fff;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 1.6rem + 5.6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-lead {
  margin-top: clamp(14px, 1.6vw, 20px);
  max-width: 64ch;
  text-wrap: balance;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  color: rgb(255 255 255 / 0.9);
}

.hero .btn {
  margin-top: clamp(22px, 2.6vw, 32px);
}

.hero-content :focus-visible { outline-color: #fff; }

.video-toggle {
  position: absolute;
  right: var(--hero-edge);
  bottom: var(--hero-pad);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(var(--scrim) / 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background-color 200ms ease, transform 120ms ease-out;
}
.video-toggle:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) {
  .video-toggle:hover { background: rgb(var(--scrim) / 0.72); }
}
/* En móvil el botón de pausa sube a la esquina para no chocar con el botón principal */
@media (max-width: 479px) {
  .video-toggle { top: var(--hero-pad); bottom: auto; }
}
.video-toggle:focus-visible { outline-color: #fff; border-radius: 50%; }
.video-toggle > * { grid-area: 1 / 1; }

.toggle-ring {
  width: 100%;
  height: 100%;
  rotate: -90deg;
  overflow: visible;
}
.toggle-ring circle { fill: none; stroke-width: 2.5; }
.ring-track { stroke: rgb(255 255 255 / 0.28); }
.ring-progress {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

/* Pausa y reproducir se funden en lugar de saltar */
.video-toggle .icon {
  width: 20px;
  height: 20px;
  transition: opacity 200ms ease, scale 200ms var(--ease-out), filter 200ms ease;
}
.video-toggle .icon-play,
.video-toggle.is-paused .icon-pause {
  opacity: 0;
  scale: 0.7;
  filter: blur(3px);
}
.video-toggle.is-paused .icon-play {
  opacity: 1;
  scale: 1;
  filter: none;
}

/* Entrada del hero: el marco se abre, el vídeo se asienta y el texto llega
   después. El titular se pinta fijo desde el principio. */
@media (prefers-reduced-motion: no-preference) {
  .hero-frame { animation: frame-in 1100ms var(--ease-out) both; }
  .hero-video { animation: settle 1800ms var(--ease-out) both; }
  .hero-lead,
  .hero .btn { animation: rise 700ms var(--ease-out) 250ms both; }
  .hero .btn { animation-delay: 330ms; }
}

/* Al bajar, el hero se retira hacia el fondo y deja paso a los precios */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-frame {
      transform-origin: 50% 100%;
      animation: frame-in 1100ms var(--ease-out) both, recede linear both;
      animation-timeline: auto, view();
      animation-range: normal, exit 0% exit 100%;
    }
  }
}

@keyframes frame-in {
  from { clip-path: inset(3% 2.5% 0 2.5% round 32px); }
  to { clip-path: inset(0 round var(--radius-lg)); }
}
@keyframes settle {
  from { scale: 1.08; }
}
@keyframes rise {
  from { opacity: 0; translate: 0 10px; }
}
@keyframes recede {
  to { scale: 0.94; opacity: 0.7; }
}

/* ---------- Presentación ---------- */
.intro {
  padding-block: clamp(80px, 11vw, 152px) clamp(80px, 10vw, 136px);
  scroll-margin-top: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 1.6rem + 3.2vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--brown);
  text-wrap: balance;
}

.intro-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  margin-top: clamp(48px, 6vw, 88px);
}

.intro-text {
  max-width: 62ch;
  color: var(--ink-soft);
}
.intro-text p + p { margin-top: 1.1em; }
.intro-text .lead + p { margin-top: 1.4em; }

.lead {
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.55;
  color: var(--ink);
}

/* En móvil las fotos abren la sección y el texto queda en un bloque continuo.
   Arriba queda sitio para la hoja y el tallo del símbolo. */
.intro-media {
  position: relative;
  isolation: isolate;
  order: -1;
  padding: 26% 0 18%;
}

/* El símbolo real del logotipo (icono.png) como máscara, en verde lavado.
   La segunda capa es un barrido cónico centrado en la C que lo "dibuja"
   desde el extremo superior de la C, pasando por el tallo y la hoja. */
.brand-mark {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 4%;
  width: 92%;
  aspect-ratio: 560 / 796;
  background: var(--brand-wash);
  pointer-events: none;
  -webkit-mask-image: url("../img/icono.png"), conic-gradient(from 67deg at 52.7% 62.7%, transparent calc(360deg - var(--sweep)), #000 0);
  mask-image: url("../img/icono.png"), conic-gradient(from 67deg at 52.7% 62.7%, transparent calc(360deg - var(--sweep)), #000 0);
  -webkit-mask-size: contain, 100% 100%;
  mask-size: contain, 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.photo {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--tint);
}

/* La foto pequeña tapa la esquina inferior izquierda (la rueda del rodillo)
   y deja libre el texto "Producto de La Palma". */
.photo-main {
  width: 84%;
  margin-left: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-inset {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  box-shadow: 0 0 0 8px var(--bg);
}

@media (min-width: 1024px) {
  .intro-body {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
  }
  .intro-text { grid-column: 1 / span 6; }
  /* Las fotos acompañan la lectura del texto */
  .intro-media {
    order: 0;
    grid-column: 8 / span 5;
    position: sticky;
    top: 32px;
  }
}

/* ---------- Precios semanales ---------- */
/* Marco redondeado, en continuidad con el del vídeo. Blanco como el listado
   de Google, para que el espacio libre del iframe se lea como aire y no como una caja vacía. */
.prices {
  margin: var(--frame) var(--frame) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding-block: clamp(64px, 8vw, 112px);
  scroll-margin-top: var(--frame);
}

.prices-inner {
  max-width: 1096px;
  /* El marco ya separa del borde: el listado aprovecha el ancho en móvil */
  padding-inline: clamp(12px, 3vw, 40px);
}

/* El listado conserva el ancho máximo de 1000px del código de inserción,
   así que esta sección se centra sobre él. */
.prices-head {
  text-align: center;
}
.prices-head p {
  margin-top: 14px;
  color: var(--ink-soft);
}
.prices-head .prices-alt { margin-top: 8px; }

.prices-panel {
  position: relative;
  margin-top: clamp(24px, 3vw, 40px);
}

/* Código de inserción de Google Drive (estilos originales) */
.drive-embed {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.drive-embed iframe {
  display: block;
  width: 100%;
  height: 600px;
  border: 0;
}

@media (max-width: 1024px) {
  .drive-embed iframe { height: 700px; }
}

@media (max-width: 767px) {
  .drive-embed iframe { height: 800px; }
}

/* Esqueleto mientras carga el listado: va por encima del iframe hasta que
   termina de cargar, porque Google pinta su página en blanco antes que las fichas. */
.drive-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-content: start;
  gap: 16px;
  max-width: 1000px;
  margin-inline: auto;
  /* Medidas del listado del Apps Script: selector de vista arriba y fichas debajo */
  padding: 78px 4px 0;
  background: var(--surface);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), visibility 0s linear 0.4s;
}
.drive-skeleton span {
  height: 214px;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, #eff2ed 30%, #f7f9f6 50%, #eff2ed 70%) 0 0 / 300% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .drive-skeleton span { animation: shimmer 1.6s linear infinite; }
}
@keyframes shimmer {
  to { background-position: -150% 0; }
}
.js .drive-skeleton { display: grid; }
.prices-panel.is-loaded .drive-skeleton { opacity: 0; visibility: hidden; }
/* En móvil el listado se abre en vista de lista */
@media (max-width: 640px) {
  .drive-skeleton { grid-template-columns: 1fr; gap: 8px; }
  .drive-skeleton span { height: 52px; border-radius: 8px; }
}

/* Aviso si el listado tarda demasiado */
.drive-slow {
  display: none;
  grid-column: 1 / -1;
  padding: 0 8px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  text-align: center;
  pointer-events: auto;
}
.prices-panel.is-slow .drive-slow { display: block; }

.prices-alt {
  font-size: 0.875rem;
  text-align: center;
}
.prices-alt a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 44px;
  font-weight: 500;
}

/* ---------- Pie ----------
   Bloque verde oscuro de la marca, con el mismo marco redondeado que el vídeo
   y los precios: cierra la página y se distingue claramente del contenido. */
.site-footer {
  position: relative; /* por encima del símbolo de la sección anterior si llegara a tocarlo */
  margin: 0 var(--frame) var(--frame);
  border-radius: var(--radius-lg);
  background: var(--green-deep);
  color: rgb(255 255 255 / 0.78);
  font-size: 0.875rem;
}
.site-footer :focus-visible { outline-color: #fff; }

.footer-top {
  display: grid;
  gap: 40px;
  padding-block: clamp(44px, 5vw, 64px);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
}
.footer-logo {
  flex: none;
  width: auto;
  height: clamp(84px, 8vw, 104px);
}

.footer-address {
  font-style: normal;
  line-height: 1.55;
}
.footer-address a {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5em;
  color: rgb(255 255 255 / 0.85);
  text-decoration: none;
}
.footer-address .icon { margin-top: 0.2em; color: var(--green-soft); }

.footer-logos {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 48px);
}
.footer-logos a {
  display: block;
  border-radius: 8px;
  transition: opacity 200ms ease;
}
.footer-logos img { width: auto; }
.logo-cabildo { height: 80px; }
/* No hay versión blanca de Sodepal: se pinta en blanco a partir del logotipo gris */
.logo-sodepal { height: 72px; filter: brightness(0) invert(1); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid rgb(255 255 255 / 0.16);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  padding: 0;
}
.legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: rgb(255 255 255 / 0.78);
}
.legal-links a[aria-current="page"] { color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .footer-logos a:hover { opacity: 0.75; }
  .footer-address a:hover,
  .legal-links a:hover {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: currentColor;
  }
}

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---------- Páginas legales ---------- */
.legal {
  padding-block: clamp(40px, 6vw, 72px) clamp(72px, 9vw, 120px);
}

.legal-inner {
  max-width: 800px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  font-weight: 500;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.legal h1 {
  margin-top: 16px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.legal-content {
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
.legal-content h2 {
  margin: 2em 0 0.6em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--brown);
}
.legal-content h3 {
  margin: 1.6em 0 0.5em;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.legal-content > :first-child { margin-top: 0; }
.legal-content p,
.legal-content ul,
.legal-content ol { margin-bottom: 1em; }
.legal-content ul,
.legal-content ol { padding-left: 1.25em; }
.legal-content li + li { margin-top: 0.35em; }
.legal-content strong { color: var(--ink); font-weight: 600; }

.table-wrap {
  margin: 1.5em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.legal-content table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.legal-content td,
.legal-content th {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}
.legal-content th {
  color: var(--ink);
  font-weight: 600;
  background: var(--tint);
}
.legal-content tbody td { border-top: 1px solid var(--line); }
.legal-content td p { margin: 0; }

/* ---------- Aparición al hacer scroll ----------
   Titular: sube detrás de una máscara.
   Fotos: el símbolo se dibuja primero y las fotos se descubren dentro. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal="mask"] {
    clip-path: inset(-0.1em 0 100% 0);
    translate: 0 0.4em;
    transition: clip-path 900ms var(--ease-out), translate 900ms var(--ease-out);
  }
  .js [data-reveal="mask"].is-visible {
    clip-path: inset(-0.1em 0 -0.3em 0);
    translate: 0 0;
  }

  .js [data-reveal="wipe"] .brand-mark {
    --sweep: 0deg;
    transition: --sweep 1800ms var(--ease-in-out);
  }
  .js [data-reveal="wipe"].is-visible .brand-mark { --sweep: 360deg; }

  .js [data-reveal="wipe"] .photo {
    clip-path: inset(100% 0 0 0 round var(--radius-md));
    scale: 1.06;
    transition: clip-path 1100ms var(--ease-out) 450ms, scale 1500ms var(--ease-out) 450ms;
  }
  .js [data-reveal="wipe"] .photo-inset {
    clip-path: inset(100% -8px -8px -8px round 22px);
    transition-delay: 700ms;
  }
  .js [data-reveal="wipe"].is-visible .photo {
    clip-path: inset(0 round var(--radius-md));
    scale: 1;
  }
  .js [data-reveal="wipe"].is-visible .photo-inset { clip-path: inset(-8px round 22px); }
}

/* ---------- Transición entre páginas ---------- */
@view-transition {
  navigation: auto;
}
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: 180ms ease-out both vt-out; }
::view-transition-new(root) { animation: 380ms var(--ease-out) both vt-in; }
@keyframes vt-out {
  to { opacity: 0; }
}
@keyframes vt-in {
  from { opacity: 0; translate: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
