/* General */
main {
  padding-top: 80px; /* espacio para el header fijo */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: #f2f2f2;
  color: #333;
}

main {
  padding: 20px;
}

/* Galería horizontal */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.gallery label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 10px;
  width: 150px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.gallery label:hover {
  transform: scale(1.05);
  border-color: #007bff;
}

.gallery img {
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  pointer-events: none;
}

/* Checkbox táctil */
input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: #007bff;
  touch-action: manipulation;
}

/* Tarjetas */
.corte,
.complemento {
  display: flex;
  flex-direction: column; /* mantiene vertical */
  align-items: center;
  width: 160px;
  margin: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
}

.corte img,
.complemento img {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  margin-bottom: 8px;
}

/* Controles de cantidad en horizontal */
.cantidad {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.cantidad button {
  width: 30px;
  height: 30px;
  font-size: 18px;
  text-align: center;
}

.cantidad input[type="number"] {
  width: 60px;
  font-size: 1.1em;
  text-align: center;
}

/* Total */
.total {
  text-align: right;
  font-size: 1.4em;
  margin-top: 20px;
}

/* Botón de envío */
button[type="submit"] {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  font-size: 1.2em;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button[type="submit"]:hover {
  background-color: #0056b3;
}

/* Header y carrito */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #f0ecec;
  color: #161616;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.carrito-header {
  font-size: 20px;
  cursor: pointer;
  background: #c7d1c8;
  padding: 8px 15px;
  border-radius: 8px;
}

.carrito-header:hover {
  background: #45a049;
}

/* Ticket estilo recibo */
.ticket {
  background: #fff;
  border: 2px dashed #333;
  border-radius: 10px;
  padding: 20px;
  width: 300px;
  margin: 20px auto;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Botón dentro del ticket */
.ticket button {
  margin-top: 10px;
  padding: 10px 20px;
  font-size: 1.1em;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.ticket button:hover {
  background: #0056b3;
}

/* Modal */
.modal {
  display: none; /* oculto por defecto */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 350px;
  text-align: center;
}

/* Botón dentro del carrito */
.carrito-actions button {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 1.0em;
  font-weight: bold;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.carrito-actions button:hover {
  background: linear-gradient(135deg, #0056b3, #004080);
  transform: scale(1.05);
}

/* Modal general */
.modal {
  display: none; /* oculto por defecto */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

/* Contenido del modal */
.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
  animation: aparecer 0.3s ease;
}

@keyframes aparecer {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Botón cerrar (X) */
.cerrar {
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  color: #555;
}

.cerrar:hover {
  color: #000;
}

/* Botón TERMINAR dentro del modal */
#btn-continuar {
  margin-top: 15px;
  padding: 12px 24px;
  font-size: 1.1em;
  font-weight: bold;
  background: linear-gradient(135deg, #28a745, #218838);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

#btn-continuar:hover {
  background: linear-gradient(135deg, #218838, #1e7e34);
  transform: scale(1.05);
}

/* === Tipografía más compacta para el ticket del carrito === */
#carrito-dropdown .ticket {
  font-size: 0.85em;            /* reduce el texto general dentro del ticket */
}

#carrito-dropdown .ticket-table {
  font-size: 0.85em;            /* asegura reducción en la tabla */
  border-collapse: collapse;
  width: 100%;
}

#carrito-dropdown .ticket-table th,
#carrito-dropdown .ticket-table td {
  padding: 6px 8px;             /* más compacto */
}

/* Encabezado y pie del ticket con tamaño menor */
#carrito-dropdown .ticket-header {
  font-size: 0.9em;
}

#carrito-dropdown .ticket-footer {
  font-size: 0.8em;
}

/* Botón dentro del carrito un poco más pequeño */
#carrito-dropdown .carrito-actions button {
  font-size: 0.95em;
}

/* === Responsivo para ticket del carrito === */

/* Móviles */
@media (max-width: 600px) {
  .ticket {
    width: 95%;
    font-size: 0.75em;
  }
  .ticket-header {
    font-size: 0.85em;
  }
  .ticket-table {
    font-size: 0.75em;
  }
  .carrito-actions button {
    font-size: 0.9em;
  }
  .corte img,
  .complemento img {
    max-width: 90px;   /* más pequeñas en pantallas chicas */
  }
/* Carrito responsivo en móviles */
  #carrito-dropdown {
    position: absolute;   /* se posiciona respecto al header */
    left: 0;              /* pegado a la izquierda */
    top: 100%;            /* justo debajo del header */
    width: 90%;          /* ocupa todo el ancho */
    padding: 10px;
  }

  #carrito-dropdown .ticket {
    width: 95%;          /* ticket ocupa todo el ancho */
    margin: 0;            /* sin márgenes laterales */
    text-align: left;     /* contenido alineado a la izquierda */
    font-size: 0.8em;     /* texto más compacto en móvil */
  }

  #carrito-dropdown .ticket-table {
    width:90%;
    font-size: 0.8em;
  }

  #carrito-dropdown .carrito-actions button {
    width: 100%;
    font-size: 0.9em;
  }
}

/* Tablets */
@media (min-width: 601px) and (max-width: 1024px) {
  .ticket {
    width: 80%;
    font-size: 0.85em;
  }
  .ticket-header {
    font-size: 0.95em;
  }
  .ticket-table {
    font-size: 0.85em;
  }
  .carrito-actions button {
    font-size: 1em;
  }
  .corte img,
  .complemento img {
    max-width: 120px;
  }
}

/* Escritorio */
@media (min-width: 1025px) {
  .ticket {
    width: 300px;
    font-size: 0.9em;
  }
  .corte img,
  .complemento img {
    max-width: 200px;
  }
}
