:root {
  --primary: #ff4757;
  --dark: #2f3542;
  --light: #f1f2f6;
  --accent: #2ed573;
  --gray: #747d8c;

  /* Escala de espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 40px;

  /* Tipografía fluida (mín. móvil / máx. desktop) */
  --font-size-body: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --font-size-h1: clamp(1.6rem, 1.3rem + 1.5vw, 2.4rem);
  --font-size-h3: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);

  /* Tap target mínimo accesible */
  --tap-target-min: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f8f9fa;
  color: var(--dark);
  font-size: var(--font-size-body);
}

/* Banner de urgencia superior */
.top-banner {
  background-color: var(--primary);
  color: white;
  text-align: center;
  padding: 8px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Navegación */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.cart-icon {
  font-size: 1.2rem;
  cursor: pointer;
  background: var(--light);
  padding: 8px 15px;
  border-radius: 20px;
  min-height: var(--tap-target-min);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #2f3542 0%, #57606f 100%);
  color: white;
}

.hero h1 {
  font-size: var(--font-size-h1);
  margin-bottom: 15px;
}

.cta-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s;
  min-height: var(--tap-target-min);
}

.cta-button:hover {
  transform: scale(1.05);
}

/* Grid de Productos */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  padding: 40px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tarjeta de Producto */
.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  position: relative;
  display: flex;
  flex-direction: column;
}

.offer-selector {
  display: flex;
  gap: 6px;
  padding: 10px 10px 0;
}

.offer-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--light);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--dark);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: var(--tap-target-min);
}

.offer-option:focus-visible,
.cta-button:focus-visible,
.add-to-cart-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.offer-option-price {
  font-size: 0.9rem;
  color: var(--primary);
}

.offer-option.active {
  border-color: var(--accent);
  background: white;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 3px;
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-info h3 {
  font-size: var(--font-size-h3);
  margin-bottom: 8px;
}

.description {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 15px;
  flex-grow: 1;
}

.rating {
  font-size: 0.85rem;
  color: var(--dark);
  margin-bottom: 8px;
}

.feature-list {
  list-style: none;
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 15px;
  padding-left: 0;
}

.feature-list li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 4px;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.urgency-timer {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 10px;
  text-align: center;
}

/* Modificador BEM: se aplica cuando el deadline persistido en localStorage ya expiró */
.urgency-timer--expired {
  color: var(--gray);
}

.price-container {
  margin-bottom: 15px;
}

.price {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--dark);
  margin-right: 8px;
}

.compare-price {
  font-size: 0.9rem;
  color: var(--gray);
  text-decoration: line-through;
}

.add-to-cart-btn {
  width: 100%;
  background: var(--dark);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  min-height: var(--tap-target-min);
}

.add-to-cart-btn:hover {
  background: var(--primary);
}

.reserva-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.reserva-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdfe4;
  border-radius: 5px;
  font-size: 0.9rem;
  min-height: var(--tap-target-min);
}

.reserva-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.reserva-status {
  font-size: 0.8rem;
  color: var(--gray);
  text-align: center;
  min-height: 1.2em;
}

.reserva-status--error {
  color: var(--primary);
  font-weight: bold;
}

/* ==========================================================================
   Mobile-first: los estilos base (arriba) son para móvil.
   min-width añade complejidad solo para pantallas más grandes.
   ========================================================================== */

/* Tablet */
@media (min-width: 768px) {
  .hero {
    padding: var(--space-6) var(--space-4);
  }

  .grid {
    gap: var(--space-6);
    padding: var(--space-6) 5%;
  }

  .offer-selector {
    gap: var(--space-2);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .navbar {
    padding: var(--space-4) 8%;
  }

  .product-card img {
    height: 240px;
  }
}