/* ------------------------------------- */
/* BASE Y RESPONSIVIDAD PRINCIPAL */
/* ------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
}
body {
  font-family: Arial, sans-serif;
  background: #f0f4f7; /* Fondo azul muy claro */
  text-align: center;
  padding: 20px;
}
h1, h2 {
    color: #004d99; /* Azul oscuro para títulos */
}

/* Contenedor de Productos */
.productos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; 
  gap: 20px;
  padding: 0;
}

/* Tarjeta de Producto */
.producto {
  background: white;
  border-radius: 10px;
  padding: 15px;
  width: 220px; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: left; 
}

/* ------------------------------------- */
/* IMÁGENES (500x500 Adaptables) */
/* ------------------------------------- */
.producto img {
    /* Dimensiones deseadas, usando object-fit para no distorsionar */
    width: 500px; 
    height: 500px; 
    object-fit: cover; 
    
    /* CLAVE para responsividad: nunca excede el ancho de la tarjeta */
    max-width: 100%; 
    height: auto; 
    
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Estilos de descripción */
.producto p.desc {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
}

/* ------------------------------------- */
/* BOTONES Y FORMULARIOS (COLOR AZUL) */
/* ------------------------------------- */
.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 15px;
  background: #007bff; /* Azul primario */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}
.btn:hover { 
    background: #0056b3; 
}

/* Formulario (generalmente para checkout) */
form {
  display: block; 
  max-width: 400px; 
  margin: 20px auto; 
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

select, button, input[type="number"] {
  margin-top: 10px;
  padding: 8px;
  width: 100%; /* Responsividad en formularios */
  box-sizing: border-box; 
}

/* Estilos de la tabla de carrito */
table {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}
th {
    background-color: #f0f0f0;
    color: #333;
}
tfoot td {
    font-size: 1.1em;
    background-color: #e6f0ff; /* Fondo azul claro para el total */
}

/* ------------------------------------- */
/* MEDIA QUERIES: Adaptación a Móviles */
/* ------------------------------------- */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .producto {
        width: 100%; 
        max-width: 400px;
        margin: 0 auto;
    }
    
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    /* Ocultar encabezados de tabla para móvil */
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* Adaptar filas y celdas */
    tr { border: 1px solid #ccc; margin-bottom: 10px; }
    
    td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50%; 
        text-align: right;
    }
    
    /* Mostrar encabezado de columna como etiqueta */
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%; 
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}