
/* Título principal */
h1 {
  margin: 10px auto 30px auto;
  font-size: 3em;
  text-align: center;
  color: #9bf5cc;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  letter-spacing: 2px; 
  padding-bottom: 15px;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: linear-gradient(to right, #80af9b, #3a7158);
  border-radius: 2px;
}

/* Container principal */
.container {
    max-width: 1200px;
    height:auto;
    margin: 0 auto 30px;
    padding: 0 1rem;
    display: block; 
}

/* Headers de sección */
.section-header {
    margin: 1rem 0 1rem 0;
    text-align: center;
    width: 100%;
    clear: both;
}

.section-header:first-of-type {
    margin-top: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    color: white;
    font-weight: 600;
    display: inline-block;
    padding: 0.5rem 2rem;
    border-bottom: 3px solid #007bff;
    margin-bottom: 1rem;
    text-transform: capitalize;
}
/* Grid de productos - EXACTAMENTE 4 COLUMNAS */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem; 
    margin-bottom: 3rem;
    width: 100%;
    max-width: 1200px; /* Contenedor específico de 1200px */
    margin: 0 auto; /* Centrar el grid */
    box-sizing: border-box; /* IMPORTANTE: incluir padding en el ancho */
}

/* Tarjetas de producto - MÁS PEQUEÑAS */
.product-card {
    background: #fff;
    border-radius: 8px; /* Reducido de 12px */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); /* Sombra más sutil */
    padding: 0.5rem; /* Reducido de 1.5rem */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 260px; /* Reducido de 330px */
    width: 100%; /* FORZAR ancho completo */
    max-width: 100%;
    box-sizing: border-box; /* IMPORTANTE: incluir padding en el ancho */
    /* FORZAR DIMENSIONES IGUALES */
    min-width: 0; /* Permitir que se contraiga */
}

.product-card:hover {
    transform: translateY(-3px); /* Reducido de -5px */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Imagen del producto - MÁS PEQUEÑA */
.product-image {
    width: 100%;
    height: 200px; /* Reducido de 200px */
    object-fit: cover;
    border-radius: 6px; /* Reducido de 8px */
    margin-bottom: 0.75rem; /* Reducido de 1rem */
    background-color: #f0f0f0;
}

/* Nombre del producto - MÁS COMPACTO */
.product-card h3 {
    font-size: 1.1rem; /* Reducido de 1.25rem */
    color: #333;
    margin-bottom: 0.5rem; /* Reducido de 0.75rem */
    font-weight: 600;
    text-align: center;
    min-height: 40px; /* Reducido de 50px */
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: capitalize;
    /* EVITAR DESBORDAMIENTO DE TEXTO */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Descripción del producto - MÁS COMPACTA */
.product-description {
    color: #666;
    font-size: 0.85rem; /* Reducido de 0.9rem */
    line-height: 1.3; /* Reducido de 1.4 */
    margin-bottom: 0.75rem; /* Reducido de 1rem */
    flex-grow: 1;
    min-height: 45px; /* Reducido de 60px */
    text-align: center;
}

/* Opciones de precio - MÁS COMPACTAS */
.price-options {
    margin-bottom: 0.75rem; /* Reducido de 1rem */
    text-align: center;
}

.price-options p {
    margin: 0.2rem 0; /* Reducido de 0.25rem */
    font-size: 0.9rem; /* Reducido de 1rem */
    color: #333;
}

.price-options strong {
    color: #007bff;
    font-weight: 600;
}


.price-options p {
    margin: 0.25rem 0;
    font-size: 1rem;
    color: #333;
}

.price-options strong {
    color: #007bff;
    font-weight: 600;
}

/* Selector de presentación */
.presentacion-selector {
    margin-bottom: 1rem;
}

.presentacion-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    text-align: center;
}

.presentacion-select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.3s ease;
    text-align: center;
}

.presentacion-select:focus {
    outline: none;
    border-color: #007bff;
}

/* Selector de cantidad */
.cantidad-selector {
    margin-bottom: 1rem;
}

.cantidad-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    text-align: center;
}

.cantidad-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.cantidad-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Precio total */
.precio-total {
    margin-bottom: 1.5rem;
    text-align: center;
}

.precio-total p {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
}

.precio-total strong {
    color: #28a745;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Botones */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: auto;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    background-color: #6c757d;
}

/* Mensaje cuando no hay productos */
.no-products {
    text-align: center;
    padding: 3rem 0;
    color: #666;
    font-size: 1.2rem;
    grid-column: 1 / -1;  /* Ocupa todas las columnas */
}

/* RESPONSIVE DESIGN */

/* Pantallas grandes (escritorio) - 4 columnas */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
    
    .container {
        max-width: 1200px;
    }
}

/* Tablets grandes - 3 columnas */
@media (max-width: 900px) and (min-width: 700px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
}

/* Tablets - 2 columnas */
@media (max-width: 700px) and (min-width: 500px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    h1 {
        font-size: 2rem;
        margin: 1.5rem 0;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
        padding: 0.5rem 1.5rem;
    }
    
    .product-card {
        padding: 1.25rem;
        min-height: 400px;
    }
    
    .product-image {
        height: 180px;
    }
}

/* Móviles - 1 columna */
@media (max-width: 500px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin:auto;
        width:50%;
    }
    
    h1 {
        font-size: 1.8rem;
        margin: 1rem 0;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
        padding: 0.5rem 1rem;
    }
    
    .section-header {
        margin: 2rem 0 1.5rem 0;
    }
    
    .product-card {
        padding: 1rem;
        min-height: 380px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-card h3 {
        font-size: 1.1rem;
        min-height: 40px;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 400px) {
    .products-grid {
        margin:auto;
        width:65%;
    }
    h1 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .product-card {
        min-height: 350px;
    }
    
    .product-image {
        height: 160px;
    }
}