/* =========================================
   1. ESTRUCTURA GENERAL DE LA PÁGINA
   ========================================= */
.page-detalle {
    max-width: 1450px; /* 1. Aumentamos el ancho total de la página */
    margin: 0 auto;
    padding: 20px 5%;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.detalle-container {
    display: grid;
    /* 2. MAGIA: 1.6fr (62%) para la galería y 1fr (38%) para el texto */
    grid-template-columns: 1.6fr 1fr; 
    gap: 60px; /* Más espacio para respirar */
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}


/* =========================================
   2. IZQUIERDA: GALERÍA PRO (FALABELLA STYLE)
   ========================================= */
.detalle-galeria-pro {
    display: grid;
    grid-template-columns: 90px 1fr; /* Miniaturas un poco más grandes */
    gap: 30px; /* Más separación entre miniaturas y foto principal */
    align-items: start;
    position: relative;
}

.thumbs-vertical-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    height: 100%;
    max-height: 600px; /* Aumentamos la altura de la columna */
}

.thumbs-vertical-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto; 
    scroll-behavior: smooth; 
    scrollbar-width: none; 
    padding: 10px 0;
    width: 100%;
}

.thumbs-vertical-container::-webkit-scrollbar { display: none; }

.miniatura-pro {
    width: 80px; /* Miniaturas más imponentes */
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    padding: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0; 
}

.miniatura-pro img { width: 100%; height: 100%; object-fit: contain; }
.miniatura-pro:hover { border-color: #bbb; }

.miniatura-pro.activa {
    border-color: var(--primary-green); 
    border-width: 2px;
    box-shadow: 0 0 5px rgba(0, 166, 81, 0.3);
}

.btn-thumb-nav {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: #555;
    width: 100%;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    border-radius: 4px;
    visibility: hidden; 
    opacity: 0;
}

.thumbs-vertical-wrapper:hover .btn-thumb-nav.visible { visibility: visible; opacity: 1; }
.btn-thumb-nav:hover { background-color: #f4f6f8; color: var(--primary-green); }
.btn-thumb-nav.up { margin-bottom: 5px; }
.btn-thumb-nav.down { margin-top: 5px; }

.imagen-principal-visualizador {
    position: relative; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.imagen-principal-box {
    width: 100%;
    min-height: 500px; /* 3. MAGIA: Quitamos el aspect-ratio cuadrado y forzamos altura */
    background-color: transparent; /* 4. MAGIA: Quitamos el fondo gris */
    border: none; /* 5. MAGIA: Quitamos el borde para que flote libremente */
    border-radius: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0 20px;
}

.img-producto-real {
    max-width: 100%;
    max-height: 600px; /* Evita que fotos muy largas rompan la pantalla */
    object-fit: contain;
    transition: transform 0.3s ease;
}

.btn-main-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: 1px solid #ddd;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0; 
    visibility: hidden;
}

.imagen-principal-visualizador:hover .btn-main-nav { opacity: 1; visibility: visible; }
.btn-main-nav:hover { background-color: var(--primary-green); color: white; border-color: var(--primary-green); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.btn-main-nav.prev { left: 0px; } /* Las pegamos a los bordes */
.btn-main-nav.next { right: 0px; }


/* =========================================
   3. DERECHA: INFO Y COMPRA
   ========================================= */
.detalle-info {
    display: flex;
    flex-direction: column;
}

.detalle-marca {
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.detalle-titulo {
    font-size: 2rem;
    color: var(--dark-gray);
    line-height: 1.2;
    margin-bottom: 25px;
}

.detalle-precios {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.precio-oferta-grande {
    font-size: 2.5rem;
    font-weight: 800;
    color: #e50029;
}

.detalle-stock {
    color: var(--primary-green);
    font-size: 1rem;
    margin-bottom: 25px;
}

.detalle-descripcion h3 {
    font-size: 1.1rem;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.detalle-descripcion p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 30px;
}

.detalle-acciones {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.selector-cantidad {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 30px;
    overflow: hidden;
    height: 50px;
}

.btn-cant {
    background: #f4f6f8;
    border: none;
    width: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
}

.btn-cant:hover { background: #e1e5eb; }

.selector-cantidad input {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    -moz-appearance: textfield;
}
.selector-cantidad input::-webkit-outer-spin-button,
.selector-cantidad input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

.btn-agregar-carrito {
    flex-grow: 1;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-agregar-carrito:hover { background-color: #003380; }

.garantia-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #666;
    font-size: 0.95rem;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* =========================================
   4. RESPONSIVIDAD (MÓVILES Y TABLETS)
   ========================================= */
@media (max-width: 900px) {
    .detalle-container { grid-template-columns: 1fr; }
    
    .detalle-galeria-pro { grid-template-columns: 1fr; }
    
    .thumbs-vertical-wrapper {
        flex-direction: row; 
        height: auto;
        max-height: none;
        order: 2; 
    }

    .thumbs-vertical-container {
        flex-direction: row;
        overflow-x: auto; 
        overflow-y: hidden;
        padding: 10px 0;
    }

    .miniatura-pro { width: 60px; height: 60px; }
    .btn-thumb-nav { display: none !important; }
    .btn-main-nav { opacity: 1; visibility: visible; width: 40px; height: 40px; }
    .btn-main-nav.prev { left: 10px; }
    .btn-main-nav.next { right: 10px; }
    
    .detalle-acciones { flex-direction: column; }
    .selector-cantidad { width: 100%; justify-content: space-between; }
    .selector-cantidad input { flex-grow: 1; }
}
