/* style.css — Coco Shopping
   Identidad boutique: Cormorant Garamond para encabezados, Manrope para textos,
   paleta crema (#FFF9F7) / arena (#F5EAE6) / rosa de marca (#D8AAA5) / café (#795A51)
   / dorado (#B98A58) / tinta (#292321). Sombras muy suaves y animaciones discretas.
   Incluye también la hoja de estilos para IMPRIMIR la etiqueta de pedido (usada por /admin). */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Manrope:wght@400;500;600;700;800&display=swap");

/* ---------- Base ---------- */
body {
  font-family: "Manrope", "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  /* Footer siempre al fondo: en páginas cortas (carrito vacío, detalle de producto)
     el contenido se estira y el footer no queda "flotando" a media pantalla. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
  width: 100%;
}

/* Serif editorial para títulos.
   (También la usa /admin/imprimir_etiqueta.php — no renombrar.) */
.font-heading {
  font-family: "Cormorant Garamond", serif;
}

html {
  scroll-behavior: smooth;
  /* Evita que el header sticky tape los títulos al navegar con anclas (#productos, etc.) */
  scroll-padding-top: 130px;
}

/* ---------- Accesibilidad: foco visible con teclado ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #795a51;
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Animaciones de entrada ---------- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out both;
}

/* Entrada escalonada: los hijos aparecen uno tras otro (hero, listas destacadas) */
.entrada-escalonada > * {
  animation: fade-in-up 0.7s ease-out both;
}
.entrada-escalonada > *:nth-child(1) { animation-delay: 0.05s; }
.entrada-escalonada > *:nth-child(2) { animation-delay: 0.15s; }
.entrada-escalonada > *:nth-child(3) { animation-delay: 0.25s; }
.entrada-escalonada > *:nth-child(4) { animation-delay: 0.35s; }
.entrada-escalonada > *:nth-child(5) { animation-delay: 0.45s; }
.entrada-escalonada > *:nth-child(6) { animation-delay: 0.55s; }

/* Escalonado para cuadrículas con .reveal (Instagram, tarjetas) */
.stagger > :nth-child(2) { transition-delay: 0.07s; }
.stagger > :nth-child(3) { transition-delay: 0.14s; }
.stagger > :nth-child(4) { transition-delay: 0.21s; }
.stagger > :nth-child(5) { transition-delay: 0.28s; }
.stagger > :nth-child(6) { transition-delay: 0.35s; }

/* Aparecer al hacer scroll (se activa con IntersectionObserver en cada página) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Header ---------- */
/* Sombra al desplazarse y ocultamiento automático al bajar (js/interfaz.js). */
.header-boutique {
  transition: box-shadow 0.3s ease, transform 0.35s ease;
}
.header-boutique.header-scrolled {
  box-shadow: 0 6px 24px rgba(41, 35, 33, 0.07);
}
.header-boutique.header-oculto {
  transform: translateY(-100%);
  box-shadow: none;
}

/* Subrayado animado de los enlaces del menú */
.enlace-menu {
  position: relative;
  transition: color 0.25s ease;
}
.enlace-menu::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: #b98a58;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.enlace-menu:hover::after,
.enlace-menu:focus-visible::after {
  transform: scaleX(1);
}

/* Paneles del header (menú móvil y barra de búsqueda): entrada suave */
@keyframes menu-baja {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.menu-movil-abierto,
.panel-abierto {
  animation: menu-baja 0.25s ease both;
}

/* ---------- Botones ---------- */
/* El "!important" en los fondos es intencional: Tailwind (cargado por CDN) inyecta su
   propio reset con background-color: transparent para <button> DESPUÉS de este archivo,
   y sin !important los botones quedaban sin relleno. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
    border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Acción principal: café elegante con texto claro */
.btn-primario {
  background: #795a51 !important;
  color: #fff9f7;
  box-shadow: 0 6px 18px rgba(121, 90, 81, 0.25);
}
.btn-primario:hover {
  background: #63483f !important;
  box-shadow: 0 10px 26px rgba(121, 90, 81, 0.33);
}

/* Acción secundaria: blanco con borde suave */
.btn-secundario {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #795a51;
  border: 1.5px solid rgba(121, 90, 81, 0.3);
  box-shadow: 0 4px 14px rgba(41, 35, 33, 0.05);
}
.btn-secundario:hover {
  background: #fff !important;
  border-color: #795a51;
}

/* Acción sobre fondos oscuros (footer) */
.btn-claro {
  background: #fff9f7 !important;
  color: #292321;
}
.btn-claro:hover {
  background: #f5eae6 !important;
}

/* Icono de navbar estilo editorial: sin círculo, solo el trazo (mockup) */
.icono-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: transparent !important;
  border: none;
  color: #292321;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.icono-nav:hover {
  color: #795a51;
  background: #f5eae6 !important;
}

/* Título de sección con líneas doradas a los lados: — CATEGORÍAS — */
.titulo-seccion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
.titulo-seccion::before,
.titulo-seccion::after {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: rgba(185, 138, 88, 0.5);
  flex-shrink: 0;
}

/* Botón redondo de icono (búsqueda, favoritos, carrito, cerrar) */
.btn-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #fff !important;
  color: #292321;
  border: 1.5px solid rgba(41, 35, 33, 0.12);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease,
    background-color 0.25s ease;
}
.btn-icono:hover {
  transform: translateY(-2px);
  border-color: #795a51;
  color: #795a51;
}

/* ---------- Tarjetas de producto ---------- */
.tarjeta-producto {
  animation: fade-in-up 0.5s ease both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tarjeta-producto:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(41, 35, 33, 0.1);
}

/* Botón "Vista rápida" sobre la fotografía: aparece al pasar el cursor o con teclado */
.vista-rapida-btn {
  opacity: 0;
  transform: translateY(8px);
}
.tarjeta-producto:hover .vista-rapida-btn,
.vista-rapida-btn:focus-visible {
  opacity: 1;
  transform: translateY(0);
}
/* En pantallas táctiles (sin hover) el botón queda siempre visible */
@media (hover: none) {
  .vista-rapida-btn {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Corazón de favoritos sobre la fotografía */
.btn-favorito {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #292321;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 3px 10px rgba(41, 35, 33, 0.12);
  transition: transform 0.25s ease, color 0.25s ease;
}
.btn-favorito:hover {
  transform: scale(1.1);
  color: #795a51;
}
.btn-favorito.activo {
  color: #795a51;
}
.btn-favorito.activo svg {
  fill: #795a51;
}

/* ---------- Filtros del catálogo ---------- */
.chip-filtro {
  border: 1.5px solid rgba(41, 35, 33, 0.14);
  background: #fff !important;
  color: #292321;
  border-radius: 9999px;
  padding: 0.55rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}
.chip-filtro:hover {
  border-color: #d8aaa5;
  color: #795a51;
  transform: translateY(-1px);
}
.chip-filtro.activo {
  background: #795a51 !important;
  border-color: #795a51;
  color: #fff9f7;
}

/* ---------- Tarjetas de categoría ---------- */
.tarjeta-categoria {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}
.tarjeta-categoria img {
  transition: transform 0.7s ease;
}
.tarjeta-categoria:hover img,
.tarjeta-categoria:focus-visible img {
  transform: scale(1.06);
}
.tarjeta-categoria .categoria-flecha {
  transition: transform 0.3s ease;
}
.tarjeta-categoria:hover .categoria-flecha {
  transform: translateX(4px);
}

/* ---------- Vista rápida (modal) ---------- */
@keyframes modal-entra {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-panel {
  animation: modal-entra 0.3s ease both;
}

/* El mapa de entrega invita a hacer clic para colocar el pin */
#mapa-entrega.leaflet-container {
  cursor: crosshair;
}

/* ---------- Formularios ---------- */
.campo {
  width: 100%;
  background: #fff;
  border: 1.5px solid #eadcd6;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  color: #292321;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.campo::placeholder {
  color: rgba(41, 35, 33, 0.35);
}
.campo:focus {
  outline: none;
  border-color: #795a51;
  box-shadow: 0 0 0 3px rgba(216, 170, 165, 0.28);
}

/* Métodos de pago como tarjetas seleccionables (el radio nativo sigue visible y accesible) */
.opcion-pago {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1.5px solid #eadcd6;
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.opcion-pago:hover {
  border-color: #d8aaa5;
}
.opcion-pago:has(input:checked) {
  border-color: #795a51;
  background: #fbf5f2;
  box-shadow: 0 4px 14px rgba(121, 90, 81, 0.1);
}
.opcion-pago input[type="radio"] {
  accent-color: #795a51;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* ---------- Aviso (toast) al agregar al carrito ---------- */
@keyframes toast-entra {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.aviso-toast {
  animation: toast-entra 0.35s ease both;
}

/* ---------- Detalles decorativos ---------- */
.divisor-dorado {
  width: 56px;
  height: 2px;
  background: #b98a58;
  border-radius: 2px;
  margin: 0.9rem auto 0;
}
.divisor-dorado-izquierda {
  margin-left: 0;
  margin-right: auto;
}

/* La línea dorada "crece" cuando su sección aparece en pantalla */
@keyframes crecer-linea {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
.reveal.reveal-visible .divisor-dorado {
  animation: crecer-linea 0.8s ease 0.25s both;
}
.reveal.reveal-visible .divisor-dorado-izquierda {
  transform-origin: left;
}

/* Flotado suave para decoraciones (círculos y manchas del hero) */
@keyframes flotar {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-12px);
  }
}
.flotante {
  animation: flotar 5s ease-in-out infinite alternate;
}
.flotante-lento {
  animation: flotar 7.5s ease-in-out infinite alternate-reverse;
}

/* Destello sutil del punto dorado del logo */
@keyframes destello {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.78);
  }
}
.punto-marca {
  animation: destello 3.2s ease-in-out infinite;
}

/* Latido del contador (carrito / favoritos) al agregar algo */
@keyframes latido {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
.latido {
  animation: latido 0.45s ease;
}

/* Manchas suaves de color detrás del hero (decoración abstracta discreta) */
.mancha {
  position: absolute;
  border-radius: 9999px;
  filter: blur(70px);
  pointer-events: none;
  animation: flotar 10s ease-in-out infinite alternate;
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .animate-fade-in-up,
  .entrada-escalonada > *,
  .tarjeta-producto,
  .aviso-toast,
  .menu-movil-abierto,
  .panel-abierto,
  .modal-panel,
  .mancha,
  .flotante,
  .flotante-lento,
  .punto-marca,
  .latido,
  .reveal.reveal-visible .divisor-dorado {
    animation: none;
  }
  .stagger > * {
    transition-delay: 0s;
  }
  .tarjeta-categoria img,
  .btn,
  .btn-icono,
  .btn-favorito,
  .vista-rapida-btn {
    transition: none;
  }
}

/* =====================================================================
   CLASES LEGADAS — las usa /admin/imprimir_etiqueta.php. NO ELIMINAR.
   ===================================================================== */
.btn-glass {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(46, 32, 24, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn-glass:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(46, 32, 24, 0.24);
}
.btn-glass-oscuro {
  background: rgba(46, 32, 24, 0.92) !important;
  color: #fff;
}
.btn-glass-oscuro:hover {
  background: rgba(46, 32, 24, 1) !important;
}

/* ---------- Etiqueta de pedido imprimible (la usa /admin) ---------- */
/* Al imprimir, ocultamos todo menos la etiqueta. */
@media print {
  body * {
    visibility: hidden;
  }

  #etiqueta-contenido,
  #etiqueta-contenido * {
    visibility: visible;
  }

  #etiqueta-contenido {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  .no-imprimir {
    display: none !important;
  }
}
