/* ========================================
   PÁGINA DE PRODUCTO INDIVIDUAL (producto.css)
   ======================================== */

/* Contenedor General */
.producto-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px; /* Padding lateral para que no toque bordes en móvil */
    min-height: 60vh;
}

/* Estado de Carga */
.loading-state-producto {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}
.loading-state-producto .spinner {
    margin: 0 auto 20px;
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3; border-top: 4px solid var(--dorado);
    border-radius: 50%; animation: spin 1s linear infinite;
}

/* Breadcrumbs (Navegación) */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #888;
}
.breadcrumbs a {
    color: #555; text-decoration: none; transition: color 0.2s;
}
.breadcrumbs a:hover { color: var(--dorado); text-decoration: underline; }
.breadcrumbs span { margin: 0 5px; color: #ccc; }

/* Contenedor Principal (Tarjeta Blanca) */
.producto-main {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    overflow: hidden; /* Para bordes redondeados */
    margin-bottom: 40px;
}

/* ========================================
   COLUMNA IZQUIERDA: GALERÍA
   ======================================== */
.producto-gallery {
    flex: 1; /* Ocupa espacio flexible */
    min-width: 40%; /* Ancho base */
    padding: 40px;
    background: #fcfcfc; /* Fondo sutilmente diferente */
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-main-img {
    width: 100%;
    max-width: 450px; /* Límite para que no sea gigante */
    aspect-ratio: 1/1; /* Cuadrado */
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 10px;
    position: relative;
    cursor: zoom-in;
}

.gallery-main-img img {
    max-width: 100%; max-height: 100%; object-fit: contain;
}

.gallery-zoom-hint {
    position: absolute; bottom: 10px; right: 10px;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(13,13,13,0.55); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem; pointer-events: none;
}

/* Miniaturas */
.gallery-thumbnails {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.thumb-img {
    width: 70px; height: 70px;
    border: 2px solid #eee; border-radius: 6px;
    padding: 5px; cursor: pointer; transition: all 0.2s;
    background: #fff;
}
.thumb-img:hover, .thumb-img.active {
    border-color: var(--dorado); transform: translateY(-2px);
}
.thumb-img img { width: 100%; height: 100%; object-fit: contain; }

/* ========================================
   COLUMNA DERECHA: INFORMACIÓN
   ======================================== */
.producto-info-detalles {
    flex: 1.2; /* Un poco más ancha que la galería */
    padding: 40px;
    display: flex; flex-direction: column;
}

/* Header: Marca y Nombre */
.info-marca {
    font-size: 0.9rem; font-weight: 700; color: var(--dorado);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

.info-nombre {
    font-size: 2rem; font-weight: 800; line-height: 1.2;
    color: #111; margin: 0 0 15px 0;
}

.info-sku {
    font-size: 0.85rem; color: #999; margin-bottom: 25px;
    font-family: monospace; letter-spacing: 0.5px;
}

/* Selector de variantes (medida, color, etc.) — dropdown para no ocupar
   media pantalla cuando hay muchas opciones (ej. colores de pastina) */
.variant-block { margin-bottom: 25px; }
.variant-label {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: #888; margin-bottom: 8px;
}
.variant-select {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 0.95rem; font-weight: 600; color: #222;
    background: #fff; cursor: pointer; font-family: inherit;
}
.variant-select:hover { border-color: var(--dorado); }
.variant-select:focus { outline: none; border-color: var(--dorado); }

/* Wrapper Marca/Precio (Tu pedido especial) */
.brand-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 25px;
}

.product-modal-brand {
    display: flex; align-items: center;
}
.product-modal-brand img { max-height: 40px; max-width: 120px; }
.product-modal-brand span { 
    font-weight: 700; text-transform: uppercase; color: #555; 
}

.product-modal-price {
    font-size: 2.2rem; font-weight: 800; color: #111;
}

/* Stock Status */
.stock-status {
    margin-bottom: 20px; padding: 12px 15px; border-radius: 6px;
    font-size: 0.95rem; font-weight: 600; display: inline-flex; align-items: center; gap: 12px;
}
.stock-status.available {
    background: #e8f5e9; color: #155724; border: 1px solid #c3e6cb;
}
.stock-status.unavailable {
    background: #fff3cd; color: #856404; border: 1px solid #ffeeba;
}

/* Caja de Descuento */
.info-descuento-efectivo {
    background: #f0fff4; border: 1px dashed #28a745;
    color: #28a745; padding: 15px; border-radius: 8px;
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 25px;
}
.info-descuento-efectivo i { font-size: 1.4rem; margin-top: 2px; }
.info-descuento-efectivo strong { color: #155724; }

/* Botón de Agregar */
.info-add-to-cart-btn {
    width: 100%; padding: 18px;
    background: var(--negro); color: var(--dorado);
    border: none; border-radius: 8px;
    font-size: 1.2rem; font-weight: 700; text-transform: uppercase;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.info-add-to-cart-btn:hover {
    background: var(--dorado); color: var(--negro);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Botón WhatsApp producto */
.btn-wsp-producto {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 14px;
    background: #25d366; color: #fff;
    border-radius: 8px; text-decoration: none;
    font-size: 1rem; font-weight: 700; text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
    margin-top: 10px;
}
.btn-wsp-producto:hover {
    background: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: #fff;
}

/* Descripción */
.info-descripcion {
    margin-top: 30px;
}
.info-descripcion h3 {
    font-size: 1.1rem; margin-bottom: 10px; color: #333;
    border-left: 4px solid var(--dorado); padding-left: 10px;
}
.info-descripcion p {
    line-height: 1.6; color: #555; font-size: 0.95rem;
}

/* ========================================
   RESPONSIVE (TABLET Y MÓVIL)
   ======================================== */

@media (max-width: 900px) {
    .producto-main {
        flex-direction: column; /* Apilar verticalmente */
    }
    
    .producto-gallery {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 30px;
    }
    
    .producto-info-detalles {
        width: 100%;
        padding: 30px;
    }
    
    .info-nombre { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    .producto-container { padding: 0 10px; margin-top: 15px; }
    .producto-main { border-radius: 8px; padding: 0; }
    
    .producto-gallery { padding: 20px; }
    .producto-info-detalles { padding: 20px; }
    
    /* En móvil, permitimos que la marca y precio se apilen si no entran */
    .brand-price-wrapper {
        flex-wrap: wrap; gap: 10px;
    }
    .product-modal-price {
        font-size: 2rem;
        margin-left: auto; /* Empujar a la derecha */
    }
    
    .info-add-to-cart-btn {
        padding: 15px; font-size: 1rem;
    }
}

/* ========================================
   LIGHTBOX DE IMAGEN (zoom)
   ======================================== */
.image-lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 3000;
    display: none;
    align-items: center; justify-content: center;
}
.image-lightbox-overlay.active { display: flex; }
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; transition: var(--transition);
}
.lightbox-close:hover { background: var(--dorado); color: #0D0D0D; border-color: var(--dorado); }
.lightbox-zoom-wrap {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    touch-action: none;
}
#lightboxImage {
    max-width: 90vw; max-height: 90vh;
    object-fit: contain;
    user-select: none; -webkit-user-drag: none;
    cursor: grab;
    touch-action: none;
}
#lightboxImage.dragging { cursor: grabbing; }