/* ====== Estilos globales ====== */
:root {
  --crema: #fff8f0;
  --granate: #8b0000;
  --dorado: #d4af37;
  --oscuro: #333;
  --gris: #555;
}

body {
  margin: 0;
  font-family: 'Lato', sans-serif;
  background: var(--crema);
  color: var(--oscuro);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  margin: 0;
}

/* ====== Hero principal ====== */
.hero {
  position: relative;
  min-height: 100vh;
  background: url('/img/hero.jpg') no-repeat center center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
}

.hero-content h1 {
  font-size: 4em;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.5em;
  margin-bottom: 30px;
}

.hero-content .btn {
  background: var(--dorado);
  color: var(--granate);
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2em;
  transition: all 0.3s ease;
}
.hero-content .btn:hover {
  background: var(--crema);
  color: var(--granate);
}

/* ====== Logo en el Hero ====== */
.hero-content .logo {
  width: 120px;
  margin-bottom: 20px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}
.hero-content .logo:hover { transform: scale(1.1); }

/* ====== Animación de nieve ====== */
.snowflake {
  position: absolute;
  top: -10px;
  color: white;
  opacity: 0.8;
  animation: fall linear infinite;
}
@keyframes fall { 0%{transform:translateY(0);} 100%{transform:translateY(100vh);} }

/* ====== Productos ====== */
.productos { padding: 60px 20px; text-align: center; }
.productos h2 { font-size: 2.5em; color: var(--granate); margin-bottom: 40px; }
.grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }

.card {
  background: #fff;
  border: 2px solid var(--dorado);
  border-radius: 12px;
  width: 250px;
  padding: 20px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; border-radius: 8px; }
.card h3 { color: var(--granate); margin: 15px 0 10px; }
.card p { color: var(--gris); }

.btn-producto {
  display: inline-block;
  margin-top: 15px;
  background: var(--granate);
  color: var(--crema);
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}
.btn-producto:hover { background: var(--dorado); color: var(--granate); }

/* ====== Historia ====== */
.historia { background: var(--crema); padding: 60px 20px; text-align: center; }
.historia h2 { font-size: 2.5em; color: var(--granate); margin-bottom: 30px; }
.historia p { max-width: 800px; margin: 15px auto; font-size: 1.2em; color: var(--gris); line-height: 1.8; }
.historia-img { margin-top: 30px; max-width: 600px; width: 100%; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* ====== CTA Intermedio ====== */
.cta-intermedio {
  background: linear-gradient(135deg, var(--granate), var(--dorado));
  color: var(--crema);
  text-align: center;
  padding: 60px 20px;
  margin: 40px 0;
  border-radius: 12px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}
.cta-box h2 { font-size: 2.2em; margin-bottom: 20px; }
.cta-box p { font-size: 1.3em; margin-bottom: 30px; }
.btn-cta {
  background: var(--crema);
  color: var(--granate);
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2em;
  transition: all 0.3s ease;
}
.btn-cta:hover { background: var(--dorado); color: var(--crema); }

/* ====== Footer ====== */
.footer { background: var(--oscuro); color: #fff; text-align: center; padding: 40px 20px; }
.footer-contenido h3 { font-family: 'Playfair Display', serif; font-size: 1.8em; margin-bottom: 15px; color: var(--dorado); }
.footer-contenido p { margin: 8px 0; font-size: 1.1em; }
.redes { margin-top: 20px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.redes a img { width: 32px; height: 32px; transition: transform 0.3s ease; }
.redes a img:hover { transform: scale(1.2); }
.footer-copy { margin-top: 25px; font-size: 0.9em; color: #bbb; }

/* ====== Santa y duendes ====== */
.navidad-container {
  position: fixed;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 9999;
  pointer-events: none;
}

/* Santa */
.santa img {
  width: 200px;
  opacity: 0;
  position: relative;
  animation-fill-mode: forwards;
}

/* Estrella fugaz */
.estrella img {
  width: 80px;
  position: fixed;
  top: 20%;
  left: -100px;
  opacity: 0;
  animation-fill-mode: forwards;
}

/* Animaciones */
/*@keyframes aparecer { to { opacity: 1; } }*/
@keyframes santaDespega {
  0% { opacity: 1; bottom: 0; left: 50%; }
  100% { opacity: 1; bottom: 80%; left: 80%; }
}
@keyframes estrellaFugaz {
  0% { opacity: 1; left: -100px; top: 20%; }
  100% { opacity: 0; left: 120%; top: -20%; }
}

/* ====== Carrito flotante ====== */
.cart-fab {
  position: fixed;
  bottom: 20px; left: 20px;
  background: var(--granate);
  color: var(--crema);
    border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  cursor: pointer;
  z-index: 10001;
}
.cart-fab #cart-badge {
  margin-left: 6px;
  background: var(--dorado);
  color: var(--granate);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}

/* Overlay detrás del carrito */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 9999;
}

/* Panel del carrito */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  border-left: 2px solid var(--dorado);
  box-shadow: -4px 0 12px rgba(0,0,0,.22);
  display: flex;
  flex-direction: column; /* header arriba, footer abajo */
  z-index: 10000;
}

/* Header fijo arriba */
.cart-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  padding: 12px;
  color: var(--granate);
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.close-cart {
  background: transparent;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  color: var(--granate);
  transition: transform 0.2s ease, color 0.2s ease;
}
.close-cart:hover {
  transform: scale(1.2);
  color: var(--dorado);
}

/* Contenido scrollable */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.cart-item {
  margin: 10px 0;
  padding: 8px;
  border-bottom: 1px solid #eee;
}
.cart-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--granate);
}

/* Controles de cantidad */
.cart-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.cart-controls button {
  background: var(--granate);
  color: var(--crema);
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.cart-controls button:hover {
  background: var(--dorado);
  color: var(--granate);
}

/* Footer fijo abajo */
.cart-footer {
  flex-shrink: 0;
  border-top: 1px solid #eee;
  padding: 12px;
  background: #fff;
}
.cart-total {
  font-size: 1.1em;
  color: var(--granate);
  margin-bottom: 10px;
  text-align: right;
}
#checkout {
  background: var(--dorado);
  color: var(--granate);
  padding: 12px;
  border-radius: 25px;
  font-weight: bold;
  width: 100%;
  cursor: pointer;
  transition: background 0.3s ease;
}
#checkout:hover {
  background: var(--granate);
  color: var(--crema);
}

/* ====== Responsive general ====== */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2.2em; }
  .hero-content p { font-size: 1.1em; }
  .hero-content .btn { font-size: 1em; padding: 12px 20px; }
  .hero-content .logo { width: 80px; }
  .grid { flex-direction: column; align-items: center; }
  .card { width: 90%; max-width: 320px; }

  /* Animación navideña en móviles */
  .navidad-container {
    flex-direction: column;
    align-items: center;
    bottom: 5%;
    gap: 10px;
    transform: translateX(-50%);
    max-width: 100vw;
    overflow-x: hidden;
  }
  .navidad-container img { max-width: 120px; height: auto; }
  .santa img { max-width: 180px; }
  .estrella img { max-width: 80px; }

  /* Carrito ocupa toda la pantalla en móviles */
  .cart-panel {
    width: 100%;
    left: 0;
    right: 0;
    border-left: none;
    border-radius: 0;
  }
  .cart-fab {
    bottom: 10px;
    left: 10px;
    padding: 8px 12px;
    font-size: 0.9em;
  }
}

/* ====== Corrección para ocultar carrito y overlay ====== */
.cart-panel[hidden],
.cart-overlay[hidden] {
  display: none !important;
}
@media (max-width: 768px) {
  /* Ajustar Santa en móviles */
  .santa img {
    max-width: 150px;   /* más pequeño para que no se corte */
    position: relative;
    left: 50%;          /* centrado */
    transform: translateX(-50%); /* asegura que quede centrado */
  }

  /* Ajustar animación de Santa en móviles */
  @keyframes santaDespegaMobile {
    0% { opacity: 1; bottom: 0; left: 50%; transform: translateX(-50%); }
    100% { opacity: 1; bottom: 20%; left: 50%; transform: translateX(-50%); }
  }
}
