/* ===== FUENTES Y VARIABLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --azul: #0ea5e9;
  --azul-oscuro: #0369a1;
  --turquesa: #06b6d4;
  --amarillo: #fbbf24;
  --naranja: #f97316;
  --rojo: #ef4444;
  --verde: #22c55e;
  --blanco: #ffffff;
  --texto: #1e293b;
  --card-bg: #ffffff;
  --sombra: rgba(0, 0, 0, 0.12);
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(160deg, #e0f7fa 0%, #b3e5fc 50%, #e8f5e9 100%);
  min-height: 100vh;
  color: var(--texto);
}

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #0284c7, #06b6d4, #0ea5e9);
  text-align: center;
  padding: 28px 20px 22px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

header::before, header::after {
  content: "🌴";
  position: absolute;
  top: 0;
  font-size: 100px;
  opacity: 0.8;
}

header::before { left: 0; }
header::after { right: 0; transform: scaleX(-1); }

header h1 {
  font-family: 'Pacifico', cursive;
  font-size: 40px;
  color: var(--amarillo);
  text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  line-height: 1.3;
}

header h3 {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 2px;
  margin-top: 6px;
  text-transform: uppercase;
}

/* ===== SECCIONES ===== */
section {
  display: none;
  padding: 20px 16px 100px;
  animation: fadeUp 0.3s ease;
  max-width: 800px; 
  margin: 0 auto;
}

section.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== MENÚ PRINCIPAL ===== */
#leche, #agua, #Bebidas, #Snacks {
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--blanco);
  background: linear-gradient(90deg, var(--azul-oscuro), var(--turquesa));
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
  text-transform: uppercase;
}

.cardsL, .cardsA, .cardsB, .cardsS {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.item-card {
  background: var(--card-bg);
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px var(--sombra);
  cursor: pointer;
  width: 100%;
}

.cardImg { width: 60px; height: 60px; object-fit: contain; }
.cardName { font-weight: 700; font-size: 13px; color: var(--texto); }
.cardPrice { font-weight: 800; color: var(--naranja); }

/* ===== DETALLE DE PRODUCTO ===== */
.detalleImg { width: 100%; max-width: 170px; margin: 10px auto; display: block; }
.detalleName { font-family: 'Pacifico', cursive; font-size: 22px; color: var(--azul-oscuro); text-align: center; }
.detallePrice { font-size: 22px; font-weight: 800; color: var(--naranja); text-align: center; }

.detalle-body {
  background: var(--blanco);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 16px var(--sombra);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detalle-info { font-size: 14px; color: #475569; line-height: 1.4; }

/* CONTENEDOR  PARA EXTRAS E INSTRUCCIONES */
#extras, .detalle-instrucciones-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-top: 5px;
}

/* Estilo específico para los extras */
#extras:not(:empty) {
  border: 2px dashed var(--turquesa);
  background: #f0fdff;
}

.detalle-textarea-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--azul-oscuro);
  display: block;
}

.detalle-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.detalle-textarea {
  width: 100%;
  height: 80px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  background: white;
}

/* ===== BOTONES DE CANTIDAD ===== */
.cantidad-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 8px;
  gap: 20px;
  margin: 10px 0;
}

.cantidad-box button {
  width: 45px;
  height: 45px;
  border: none;
  background: #e2e8f0;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CARRITO ===== */
#contenidoC { width: 100%; display: flex; flex-direction: column; gap: 15px; }

.carrito-item {
  background: var(--blanco);
  border-radius: 16px;
  padding: 20px;
  width: 100%; 
  box-shadow: 0 4px 12px var(--sombra);
  border-left: 6px solid var(--turquesa);
  display: flex;
  flex-direction: column;
  position: relative;
}

.btn-eliminar {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #fee2e2;
  color: var(--rojo);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

/* TOTAL */
.total-box {
  background: var(--blanco);
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 12px var(--sombra);
}

/* ===== BOTONES DE ACCIÓN ===== */
.add-btn, #irCarrito, #confirmarP {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  color: white;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.add-btn { background: linear-gradient(135deg, var(--verde), #16a34a); }
#irCarrito, #confirmarP { background: linear-gradient(135deg, var(--amarillo), var(--naranja)); }

.detalle-back {
  display: block;            
  margin: 0 auto 20px;         
  background: linear-gradient(135deg, var(--azul), var(--turquesa));
  color: white;
  padding: 10px 24px;
  border-radius: 50px;         
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
  transition: transform 0.2s;
}

.detalle-back:active {
  transform: scale(0.95);      
}

/* ===== FLOTANTE ===== */
.flotante {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, var(--azul), var(--turquesa));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(6,182,212,0.5);
  z-index: 1001;
}

.contador {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--naranja);
  color: white;
  padding: 2px 8px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

/* ===== SECCIÓN DE PAGO ===== */
.pago-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

/* Inputs blancos redondeados */
.pago-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    outline: none;
}

/* Alineación de los radio buttons */
.metodo-pago {
    display: flex;
    gap: 15px;
    font-size: 14px;
    font-weight: 700;
    color: var(--azul-oscuro);
    padding-left: 5px;
}

.metodo-pago label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Botón Confirmar */
#confirmarP {
    background: linear-gradient(to bottom, #ff9124, #ff7300);
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 0px #cc5c00;
    margin-top: 10px;
    transition: all 0.1s;
}

#confirmarP:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0px #cc5c00;
}

/* Botón Regresar */
.btn-regresar-pago {
    background: #00b4d8;
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 700;
    width: fit-content;
    margin: 10px auto 0;
    cursor: pointer;
    display: block;
}

.btn-regresar-pago:active {
    opacity: 0.8;
}

.extra-item {
    padding: 8px 0;
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 14px;
}

.extra-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.extra-group {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 600px) {
  header {
    padding: 20px 10px 15px;
  }
  
  header h1 {
    font-size: 28px; 
  }

  header::before, header::after {
    font-size: 60px; 
    top: 10px;
  }

  .cardsL, .cardsA, .cardsB, .cardsS {
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px;
    padding: 0 5px;
  }

  .item-card {
    flex-direction: column; 
    padding: 12px 8px;
    text-align: center;
    height: 100%;
  }

  .cardInfo {
    order: 2; 
    margin-top: 8px;
  }

  .cardImg {
    width: 80px; 
    height: 80px;
    order: 1;
  }

  .cardName {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
  }

  .detalleImg {
    max-width: 150px;
  }

  .detalle-body {
    padding: 15px;
    border-radius: 15px;
  }

  .add-btn, #irCarrito, #confirmarP {
    padding: 18px;
    font-size: 18px;
  }

  .carrito-item {
    padding: 15px;
  }

  .carrito-header h4 {
    font-size: 15px;
    max-width: 85%; 
  }

  .pago-container {
    width: 100%;
    padding: 10px;
  }

  .pago-input {
    font-size: 16px; 
  }

  .metodo-pago {
    justify-content: space-around;
    padding: 10px 0;
  }

  .flotante {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 380px) {
  .cardsL, .cardsA, .cardsB, .cardsS {
    grid-template-columns: 1fr;
  }
  
  header h1 {
    font-size: 24px;
  }
}