*, *::before, *::after {
    box-sizing: border-box;
}

.modal-vp {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

.modal-content-vp {
    overflow: hidden;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    padding: 30px; /* Más aire interno */
    border-radius: 40px;
    width: 40vw; /* Más ancho para que no se vea apretado */
    max-width: 1200px; /* Límite para pantallas ultra anchas */
    height: auto;
    max-height: 90vh;
    color: black;
}

/* =========================================
   BOTÓN CERRAR
   ========================================= */
.close {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 25px; /* Botón más grande */
    cursor: pointer;
    background: linear-gradient(135deg, #dc3545 0%, #8b0000 100%);
    padding: 10px 15px;
    color: white;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.close:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #c82333 0%, #6a0f0f 100%);
}

#name-sombrero-vp {
    text-align: center;
    font-size: 2.5rem; /* Letra más grande */
    margin: 0 0 1.5rem 0;
    padding: 0 60px; /* Evita que choque con el botón cerrar */
}

/* =========================================
   ESTRUCTURA DE COLUMNAS (PC)
   ========================================= */
#complete {
    height: auto;
    display: flex;
    flex-direction: row;
    gap: 30px; /* Más separación entre foto y texto */
}

#img-sombrero {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#info-sombrero {
    width: 50%;
    display: flex;
    flex-direction: column;
}

#precio-vp {
    color: #AC7F5E;
    font-size: 3rem; /* Precio gigante y llamativo */
    margin: 0;
    font-weight: bold;
}

.details-sombrero {
    color: #6b6b6b;
    font-size: 1.5rem; /* Regresamos al tamaño grande original */
    margin: 0.5rem 0;
    padding: 0;
}

/* =========================================
   TALLAS Y BOTONES
   ========================================= */
#container-tallas {
    display: grid;
    /* Ajustado para que los recuadros de talla sean más grandes */
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr)); 
    gap: 15px;
    padding: 15px 0;
}

.talla {
    color: #8C8C8C;
    padding: 0.8rem 0;
    font-weight: bold;
    font-size: 2rem; /* Regresamos al tamaño gigante original */
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.talla:hover {
    background-color: #e0e0e0;
}

.talla.selected {
    background-color: #8B0000;
    color: white;
    border-color: #5c0000;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.3);
}

#elements-inf-somb {
    display: flex;
    margin-top: auto; 
    gap: 20px;
    align-items: center;
    padding-top: 20px;
}

#cant-products {
    padding: 0.8rem;
    font-size: 2rem; /* Número de cantidad mucho más grande */
    width: 90px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 10px;
}

#btn-AggCart {
    color: #fff;
    border-radius: 10px;
    font-size: 1.6rem; /* Botón de agregar más grande */
    padding: 1.2rem;
    border: none;
    background: linear-gradient(135deg, #4C8F43 0%, #3a6b34 100%);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-weight: bold;
    flex-grow: 1; 
}

#btn-AggCart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #3a6b34 0%, #2d5528 100%);
}

/* =========================================
   GALERÍA DE IMÁGENES
   ========================================= */
#vista-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 380px; /* Imagen mucho más grande para PC */
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

#vista-foto img {
    max-height: 100%;   
    max-width: 100%;
    object-fit: contain;
}

#vista-miniaturas {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
    overflow-x: auto; 
}

.thumbnail-modal {
    width: 80px; /* Miniaturas más grandes */
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.thumbnail-modal:hover {
    transform: scale(1.05);
    border-color: #8B0000;
}

/* =========================================
   RESPONSIVIDAD CELULARES Y TABLETS
   ========================================= */
/* =========================================
   RESPONSIVIDAD CELULARES Y TABLETS (COMPACTO)
   ========================================= */
@media screen and (max-width: 768px) {
    .modal-content-vp {
        width: 95vw;
        padding: 15px; /* Menos padding para ganar espacio interior */
        max-height: 95vh; /* Le damos permiso de usar casi toda la pantalla */
        overflow-y: auto;
        border-radius: 20px;
        
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Hacemos el botón de cerrar un poco más discreto en celular */
    .close {
        top: 15px;
        right: 15px;
        font-size: 20px;
        padding: 8px 12px;
    }

    #complete {
        flex-direction: column;
        gap: 5px; /* Reducimos el espacio entre foto e info */
    }

    #img-sombrero, #info-sombrero {
        width: 100%;
    }

    #name-sombrero-vp {
        font-size: 1.5rem; /* Tamaño optimizado para que quepa en 1 o 2 renglones */
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        padding: 0 45px; /* Evita chocar con la X */
    }

    /* === IMAGEN Y MINIATURAS MÁS COMPACTAS === */
    #vista-foto {
        height: 200px; /* Reducimos drásticamente la altura de la foto para ahorrar espacio */
        padding-bottom: 5px;
        border-bottom: none; /* Quitamos la línea para que se vea más limpio */
    }

    #vista-miniaturas {
        padding: 5px 0 10px 0;
        gap: 10px;
    }

    .thumbnail-modal {
        width: 50px; /* Miniaturas más pequeñas */
        height: 50px;
    }

    /* === TEXTOS Y TALLAS COMPACTAS === */
    #precio-vp {
        font-size: 2rem;
        text-align: center;
    }

    .details-sombrero {
        text-align: center;
        font-size: 1.1rem;
        margin: 0.2rem 0;
    }

    #container-tallas {
        /* Los cuadritos de talla se hacen más chicos para que quepan más por renglón */
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr)); 
        gap: 8px;
        padding: 10px 0;
    }

    .talla {
        font-size: 1.3rem;
        padding: 0.5rem 0;
        border-radius: 8px;
    }

    /* === BOTONES EN LA MISMA LÍNEA === */
    #elements-inf-somb {
        flex-direction: row; /* PONEMOS LOS BOTONES LADO A LADO para ahorrar altura */
        width: 100%;
        gap: 15px;
        padding-top: 10px;
    }

    #cant-products {
        width: 70px; /* Input de cantidad más ajustado */
        font-size: 1.5rem;
        padding: 0.6rem;
    }

    #btn-AggCart {
        padding: 12px;
        font-size: 1.2rem;
        flex-grow: 1; /* Rellena el resto del espacio a la derecha */
    }
}