/* Educando con Perspectiva — capa de compra (tienda.css) */

/* ------------------------------------------------------------------
   PALETA DE MARCA
   Azul petróleo #1F4E5F · Vino #5A2A41 · Terracota #B35C44
   Dorado suave #C29A5B · Crema #F5F0E6
   Se definen con y sin prefijo --color- para cubrir cómo Tailwind
   lee los colores del tema.
   ------------------------------------------------------------------ */
:root {
  --brand-petroleo: #1F4E5F;
  --brand-vino: #5A2A41;
  --brand-terracota: #B35C44;
  --brand-dorado: #C29A5B;
  --brand-crema: #F5F0E6;

  --background: #F5F0E6;          --color-background: #F5F0E6;
  --foreground: #1E2B30;          --color-foreground: #1E2B30;
  --card: #FBF8F2;                --color-card: #FBF8F2;
  --muted: #E9E1D2;               --color-muted: #E9E1D2;
  --muted-foreground: #5C676B;    --color-muted-foreground: #5C676B;
  --primary: #1F4E5F;             --color-primary: #1F4E5F;
  --primary-foreground: #F5F0E6;  --color-primary-foreground: #F5F0E6;
  --secondary: #ECE4D5;           --color-secondary: #ECE4D5;
  --accent: #C29A5B;              --color-accent: #C29A5B;
  --accent-foreground: #1E2B30;   --color-accent-foreground: #1E2B30;
  --border: #DDD3C1;              --color-border: #DDD3C1;
  --input: #D3C7B2;               --color-input: #D3C7B2;
  --ring: #1F4E5F;                --color-ring: #1F4E5F;
  --ink: #173E4B;                 --color-ink: #173E4B;
  --ink-foreground: #F5F0E6;      --color-ink-foreground: #F5F0E6;
  --ink-muted: #B7C3C4;           --color-ink-muted: #B7C3C4;
}

/* Llamadas a la acción: vino profundo, terracota al pasar el cursor */
.ecp-cta { background-color: var(--brand-vino) !important; color: var(--brand-crema) !important; }
.ecp-cta:hover { background-color: var(--brand-terracota) !important; }

/* Banda del newsletter en vino (contenido de alto impacto) */
.ecp-band-vino { background-color: var(--brand-vino) !important; }

/* Detalles en terracota: línea decorativa */
.rule-ochre { background: linear-gradient(90deg, var(--brand-dorado), var(--brand-terracota)) !important; }

/* Encabezado sin foto: azul petróleo con un halo dorado suave */
.ecp-hero { background-color: var(--brand-petroleo) !important; }
.ecp-hero-glow {
  background:
    radial-gradient(60% 70% at 85% 30%, rgb(194 154 91 / 0.22) 0%, rgb(194 154 91 / 0) 70%),
    radial-gradient(50% 60% at 10% 100%, rgb(23 62 75 / 0.9) 0%, rgb(23 62 75 / 0) 70%),
    linear-gradient(160deg, #1F4E5F 0%, #1A4453 55%, #163B48 100%);
}

.ecp-reset {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: inherit;
  cursor: pointer;
}
.ecp-block { display: block; width: 100%; }
.ecp-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.ecp-hidden { display: none !important; }

.ecp-reset:focus-visible,
.ecp-select:focus-visible,
.ecp-faq summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 0.75rem;
}

/* Tarjetas */
.ecp-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; list-style: none; padding: 0; }
.ecp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ecp-actions > * { flex: 1 1 auto; }
.ecp-actions > a { flex-grow: 3; }

/* Barra de filtros */
.ecp-toolbar-right { display: flex; align-items: center; gap: 1rem; }
.ecp-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.25rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  cursor: pointer;
}

/* Ficha rápida */
.ecp-dialog {
  margin: auto;
  padding: 0;
  border: 0;
  width: min(960px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  overscroll-behavior: contain;
}
.ecp-dialog::backdrop { background: rgb(20 18 16 / 0.6); backdrop-filter: blur(2px); }
.ecp-dialog[open] { animation: ecp-in 0.22s ease-out; }
@keyframes ecp-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ecp-dialog[open] { animation: none; } }

.ecp-qv-grid { display: grid; }
@media (min-width: 768px) { .ecp-qv-grid { grid-template-columns: 1fr 1.1fr; } }
.ecp-qv-media { position: relative; }
@media (min-width: 768px) { .ecp-qv-media { align-self: start; position: sticky; top: 0; } }
.ecp-qv-media > img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.ecp-close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; }

/* Preguntas frecuentes */
.ecp-faq details summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ecp-faq details summary::-webkit-details-marker { display: none; }
.ecp-faq details summary svg { transition: transform 0.2s; flex-shrink: 0; }
.ecp-faq details[open] summary svg { transform: rotate(180deg); }

/* Menú móvil */
.ecp-mobile-menu a { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; }
.ecp-mobile-menu a.ecp-mobile-cta { justify-content: center; padding: 0 1.75rem; }

/* ------------------------------------------------------------------
   Barra superior en azul petróleo (texto crema, acentos dorados)
   ------------------------------------------------------------------ */
body > header {
  background-color: var(--brand-petroleo) !important;
  border-color: rgb(245 240 230 / 0.12) !important;
  color: var(--brand-crema);
}
body > header .font-display { color: var(--brand-crema) !important; }
body > header .font-display .italic { color: var(--brand-dorado); }
body > header .text-foreground { color: var(--brand-crema) !important; }
body > header .text-muted-foreground { color: rgb(245 240 230 / 0.75) !important; }
body > header nav a:hover { color: var(--brand-crema) !important; }
body > header nav [aria-current="page"] { background-color: rgb(245 240 230 / 0.12) !important; color: var(--brand-crema) !important; }
body > header .border-border { border-color: rgb(245 240 230 / 0.14) !important; }
body > header .bg-background { background-color: var(--brand-petroleo) !important; }
body > header a[aria-label="Ver carrito"]:hover,
body > header #ecp-menu-btn:hover { background-color: rgb(245 240 230 / 0.12) !important; color: var(--brand-crema) !important; }
body > header .ecp-cta { background-color: var(--brand-dorado) !important; color: #1E2B30 !important; }
body > header .ecp-cta:hover { background-color: var(--brand-terracota) !important; color: var(--brand-crema) !important; }

/* Galería de producto */
.ecp-alt { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s ease; }
.group:hover .ecp-alt, .group:focus-within .ecp-alt { opacity: 1; }
@media (hover: none) { .ecp-alt { display: none; } }
.ecp-photos { position: absolute; right: 0.75rem; bottom: 0.75rem; }
.ecp-thumbs {
  display: flex; gap: 0.625rem; padding: 0.875rem 1rem;
}
.ecp-thumbs button {
  width: 4rem; height: 4rem; border-radius: 0.75rem; overflow: hidden; padding: 0;
  border: 2px solid transparent; cursor: pointer; background: none;
  opacity: 0.6; transition: opacity 0.2s, border-color 0.2s;
}
.ecp-thumbs button:hover { opacity: 1; }
.ecp-thumbs button[aria-pressed="true"] { opacity: 1; border-color: var(--brand-dorado, #C29A5B); }
.ecp-thumbs button:focus-visible { outline: 2px solid var(--brand-petroleo, #1F4E5F); outline-offset: 2px; }
.ecp-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Retrato de la fundadora más pequeño */
section[aria-labelledby="founder-title"] > div > div.relative {
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  section[aria-labelledby="founder-title"] > div > div.relative { max-width: 380px; }
}

/* Precio y botón de compra siempre visibles en la ficha */
.ecp-buybar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0 -1.75rem;
  padding: 1.5rem 1.75rem 1.25rem;
  box-shadow: 0 -12px 20px -16px rgb(30 43 48 / 0.35);
}
@media (min-width: 768px) {
  .ecp-buybar { margin: 0 -2rem; padding: 1.5rem 2rem 1.25rem; }
}
.ecp-buybar #qv-buy { margin-top: 0.75rem; }

/* "También en redes": botones compactos y publicaciones más contenidas */
.ecp-social { flex-wrap: wrap; align-items: flex-start; }
.ecp-social > a {
  height: 2.75rem !important;
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
  font-size: 0.875rem !important;
}
section[aria-labelledby="ig-title"] a.grid {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  section[aria-labelledby="ig-title"] a.grid { margin-right: 0; }
}
