:root {
  /* --- PALETA DE COLORES DEFINIDA --- */
  /* Azul: Header y Footer (Confianza y Seguridad) */
  --color-blue: #0F1111;       /* Casi negro, estilo Amazon moderno */
  --color-blue-light: #232F3E; /* Azul oscuro para barra de navegación */

  /* Rojo: Ofertas y Urgencia (Sin ser neón) */
  --color-red: #B12704;

  /* Verde: Botones de Acción (WhatsApp/Compra) */
  --color-green: #2E7D32;
  --color-green-hover: #1B5E20;

  /* Neutros */
  --color-white: #FFFFFF;
  --color-bg: #E3E6E6;         /* Gris muy suave para el fondo */
  --text-main: #333333;
  --text-light: #565959;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--color-bg);
  color: var(--text-main);
  padding-bottom: 80px; /* Espacio para no tapar el footer con el scroll */
}

/* 1. BANNER DE ALERTA (Rojo) */
.scarcity-banner {
  background-color: var(--color-red);
  color: var(--color-white);
  text-align: center;
  font-size: 0.9rem;
  padding: 8px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2000;
}

/* 2. HEADER PRINCIPAL (Azul) */
.amazon-header {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.header-top {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 20px;
}

/* Logo y Texto */
.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.express-badge {
  font-size: 0.8rem;
  background: var(--color-red);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Barra de Búsqueda */
.search-bar { 
  flex-grow: 1;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  height: 40px; 
}

.search-bar input {
  width: 100%;
  padding: 0 15px;
  border: none;
  outline: none;
  font-size: 1rem;
}

.search-bar button { 
  background-color: #FEBD69; /* Amarillo clásico de búsqueda (más suave) */
  border: none;
  width: 50px;
  cursor: pointer;
  color: #333;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.search-bar button:hover {
  background-color: #F3A847;
}

/* Icono Carrito */
.cart-area {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 1.2rem;
  cursor: pointer;
}

.cart-count {
  font-weight: bold;
  color: #F3A847;
  font-size: 1rem;
}

/* Navegación Secundaria (Azul más claro) */
.header-nav { 
  background-color: var(--color-blue-light);
  padding: 8px 20px;
  display: flex;
  gap: 20px; 
  overflow-x: auto;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-nav a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover {
  text-decoration: underline;
}

/* 3. HERO SECTION (Imagen g.jpg) */
.amazon-hero {
  /* Capa oscura (gradiente) + Imagen g.jpg */
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('g.jpg');
  background-size: cover;
  background-position: center;

  padding: 60px 20px;
  position: relative;
  color: var(--color-white);
  text-align: center;
  /* Sombra al texto para que se lea siempre */
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.season-tag {
  background: var(--color-red);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
}

.hero-content h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

/* 4. GRID DE PRODUCTOS */
.content-wrapper {
  padding: 0 20px;
  max-width: 1400px;
  margin: -40px auto 0; /* Efecto solapado sobre el banner */
  position: relative;
  z-index: 10;
}

.deals-header {
  background: var(--color-white);
  padding: 15px 20px;
  border-radius: 4px 4px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.deals-header h2 { color: var(--text-main); font-size: 1.2rem; }
.deals-header a { color: #007185; text-decoration: none; font-size: 0.9rem; }

.amazon-grid {
  display: grid;
  /* Columnas automáticas: Mínimo 220px de ancho */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  background: var(--color-white);
  padding: 20px;
  border-radius: 0 0 4px 4px;
}

/* TARJETAS (CARDS) */
.amz-card {
  background: var(--color-white);
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  transition: box-shadow 0.2s;
}

.amz-card:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Badge "Casi Agotado" */
.best-seller-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: #C45500; /* Naranja quemado */
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 4px 8px;
  z-index: 2;
}

/* IMAGEN DEL PRODUCTO (Importante: contain) */
.amz-img {
  width: 100%;
  height: 180px;
  object-fit: contain; /* Esto evita que se corten o deformen */
  margin-bottom: 10px;
  padding: 5px;
}

/* Info del Producto */
.amz-info h3 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 5px;
  font-weight: 600;
  /* Cortar texto largo */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.4rem; /* Altura fija para alineación */
}

/* Estrellas */
.rating {
  color: #FFA41C;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* Precios */
.price-block { margin-bottom: 10px; }

.discount-tag {
  background: var(--color-red);
  color: white;
  padding: 2px 6px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 2px;
  margin-right: 5px;
}

.old-price {
  color: var(--text-light);
  text-decoration: line-through;
  font-size: 0.85rem;
}

.price-whole {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Advertencia de Stock (Rojo) */
.stock-warning {
  font-size: 0.8rem;
  margin-bottom: 15px;
  color: var(--color-red);
  font-weight: 600;
}

/* BOTÓN DE COMPRA (VERDE) */
.btn-buy {
  background-color: var(--color-green); /* Verde WhatsApp */
  color: white;
  border: none;
  border-radius: 20px; /* Redondeado estilo botón moderno */
  padding: 10px;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-buy:hover {
  background-color: var(--color-green-hover);
}

/* 5. FOOTER (Azul) */
.amazon-footer {
  background: var(--color-blue-light);
  color: #DDD;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 40px;
}

.back-to-top {
  background: #37475A;
  padding: 15px;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.footer-links { padding: 30px 15px; }

/* 6. BOTÓN FLOTANTE WHATSAPP */
.float-wa {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 9999;
  transition: transform 0.3s;
  text-decoration: none;
}

.float-wa:hover {
  transform: scale(1.1);
}

/* 7. UPSELL (Historial) */
.upsell-section { 
  max-width: 1400px; 
  margin: 20px auto; 
  padding: 0 20px; 
}

.upsell-card { 
  background: white; 
  padding: 15px; 
  border: 1px solid #ddd;
  border-radius: 4px;
}

.history-grid { 
  display: flex; 
  gap: 10px; 
  margin-top: 10px; 
  overflow-x: auto; 
}

.history-grid img { 
  width: 80px; 
  height: 80px; 
  object-fit: contain; 
  border: 1px solid #eee; 
  padding: 5px;
}

/* RESPONSIVE (Móvil) */
@media (max-width: 768px) {
  .amazon-grid {
      grid-template-columns: repeat(2, 1fr); /* 2 columnas en móvil */
      padding: 10px;
      gap: 10px;
  }

  .search-bar { display: none; } /* Ocultar búsqueda en pantallas pequeñas */

  .hero-content h1 { font-size: 1.5rem; }

  .amz-img { height: 140px; }

  .btn-buy { font-size: 0.8rem; padding: 8px; }
}