/* =======================================================
   ESTILO MERCADO LIBRE 2024 - CLONE
======================================================= */
:root {
    --ml-blue: #3483fa;
    --ml-blue-dark: #2968c8;
    --ml-bg: #ededed;
    --ml-yellow-star: #ffe600; /* Color amarillo ML */
    --ml-gray-star: #e2e2e2;   /* Color gris ML */
}

body {
    background-color: var(--ml-bg);
    font-family: 'Manrope', sans-serif;
    color: #333;
}

/* =======================================================
   GRID PRINCIPAL
======================================================= */
.ml-main-container {
    max-width: 1184px;
    margin: 20px auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.12);
    display: grid;
    padding-bottom: 40px;
}

/* EN ESCRITORIO (Pantallas grandes) */
@media (min-width: 1000px) {
    .ml-main-container {
        grid-template-columns: 480px 1fr 350px; /* 3 Columnas */
        align-items: start;
        padding: 16px;
        margin-top: 20px;
    }
    .ml-col-gallery { grid-column: 1 / 2; }
    .ml-col-center { 
        grid-column: 2 / 3; 
        padding: 0 24px;
    }
    .ml-col-buybox { grid-column: 3 / 4; }
    
    /* Ocultamos el título móvil en escritorio */
    .ml-header-mobile-only { 
        display: none !important; 
    }
}

/* =======================================================
   COLUMNA 1: GALERÍA
======================================================= */
.ml-gallery-wrapper { display: flex; gap: 16px; height: 500px; }
.miniSwiper { width: 60px; height: 100%; flex-shrink: 0; }
.miniSwiper .swiper-slide {
    height: 50px !important; border: 1px solid #ccc; border-radius: 4px; cursor: pointer;
    overflow: hidden; opacity: 0.7; margin-bottom: 8px !important;
}
.miniSwiper .swiper-slide-thumb-active { border-color: var(--ml-blue); border-width: 2px; opacity: 1; }
.miniSwiper img, .mainSwiper img { width: 100%; height: 100%; object-fit: contain; }

.mainSwiper { width: 100%; height: 100%; }

/* ARREGLO IMAGEN */
.zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.zoom-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    cursor: zoom-in;
}

/* =======================================================
   COLUMNA 2: INFO CENTRAL
======================================================= */
.status-label { font-size: 14px; color: rgba(0,0,0,.55); margin-bottom: 8px; display: block; }
.ml-header-desktop h1 { font-size: 22px; line-height: 1.18; font-weight: 600; color: #333; margin-bottom: 8px; }

/* =================================================================
   🔥 ESTRELLAS REALISTAS (SVG MASK) - ESTILO E-COMMERCE REAL 🔥
================================================================= */

/* Contenedores de estrellas */
.estrellas-block, 
.stars-static, 
.estrellas-php { 
    display: inline-flex !important; 
    align-items: center; 
}

/* Eliminamos cualquier rastro de texto o pseudo-elementos anteriores */
.star::before, .star::after { content: none !important; }

/* Estilo base de la estrella (la forma del icono) */
.star {
    display: inline-block;
    width: 18px; /* Tamaño base */
    height: 18px;
    margin-right: 1px;
    /* Definimos la forma usando un icono SVG como máscara */
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    background-color: var(--ml-gray-star); /* Color por defecto (vacía) */
}

/* Colores según el tipo de estrella */
.star.full {
    background-color: var(--ml-yellow-star); /* Amarilla sólida */
}
.star.half {
    /* Degradado para la media estrella */
    background: linear-gradient(to right, var(--ml-yellow-star) 50%, var(--ml-gray-star) 50%);
}
.star.empty {
   background-color: var(--ml-gray-star); /* Gris sólida */
}

.calif { font-size: 14px; color: #666; margin-left: 6px; }

/* Especificaciones + Descripción integrada */
.ml-section-specs { margin-top: 32px; }
.ml-section-specs h3 { font-size: 18px; margin-bottom: 16px; font-weight: 400; color: #333; }
.ml-specs-list { list-style: none; padding: 0; margin-bottom: 30px; }
.ml-specs-list li { font-size: 14px; line-height: 1.3; margin-bottom: 10px; position: relative; padding-left: 20px; }
.ml-specs-list li:before { content: "•"; position: absolute; left: 0; font-size: 18px; line-height: 1; }

.descripcion-integrada {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* =======================================================
   COLUMNA 3: BUY BOX ESTILO MATTEL / FULL
======================================================= */
.ml-col-buybox {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ml-card-buybox {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 24px;
    background: white;
}

/* Precios */
.ml-price-container { margin-bottom: 8px; }
.price-old { font-size: 14px; color: #999; text-decoration: line-through; margin-bottom: 4px; display: block; }
.price-row { display: flex; align-items: center; gap: 10px; }
.price-main { font-size: 36px; font-weight: 300; color: #333; line-height: 1; }
.discount-tag { font-size: 18px; color: #00a650; font-weight: 400; }

.ml-installments { font-size: 16px; margin-bottom: 20px; color: #333; }
.ml-installments span { color: #00a650; }

/* Envío y Countdown */
.ml-shipping-info { margin-bottom: 24px; }
.green-txt { color: #00a650; font-size: 16px; margin-bottom: 2px; display: block; }
.sub-txt { color: #999; font-size: 13px; display: block; margin-bottom: 4px; }
.orange-count { color: #f23d4f; font-weight: 400; }
.ml-link { color: var(--ml-blue); text-decoration: none; font-size: 14px; font-weight: 600; display: block; margin-top: 4px; }

/* Stock y FULL */
.stock-info-mattel { margin-bottom: 24px; font-size: 16px; color: #333; }
.full-badge {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.full-icon { display: inline-flex; align-items: center; color: #00a650; font-weight: 800; font-style: italic; }
.full-icon svg { margin-right: -2px; }

/* Selector Cantidad */
.qty-selector-mattel {
    margin-top: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.arrow-down { color: var(--ml-blue); font-size: 18px; margin: 0 4px; font-weight: bold; }
.stock-qty-gray { color: #999; font-size: 14px; margin-left: 4px; font-weight: 400; }

/* Botones */
.ml-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.btn-ml-primary {
    background: var(--ml-blue);
    color: white;
    border: none;
    height: 48px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-ml-primary:hover { background: var(--ml-blue-dark); }

.btn-ml-secondary {
    background: #e6f0fa;
    color: var(--ml-blue);
    border: none;
    height: 48px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-ml-secondary:hover { background: #d0e4fc; }

/* Vendedor estilo Tienda Oficial */
.seller-official-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}
.seller-logo-container {
    width: 48px;
    height: 48px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #eee;
}
.seller-logo-container img { width: 100%; height: auto; object-fit: contain; }

.seller-info-text { display: flex; flex-direction: column; }
.seller-title { font-size: 14px; font-weight: 600; color: #333; margin: 0 0 2px 0; display: flex; align-items: center; gap: 4px; }
.check-icon { width: 14px; height: 14px; }
.seller-sales { font-size: 14px; color: #666; margin: 0; font-weight: 600; }

.ml-trust-badges .badge-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.badge-icon { width: 18px; opacity: 0.6; margin-top: 2px; }
.ml-trust-badges p { font-size: 14px; color: #999; margin: 0; line-height: 1.35; }
.ml-trust-badges a { color: var(--ml-blue); text-decoration: none; }

/* =======================================================
   SECCION OPINIONES (EXTERNA)
======================================================= */
.opiniones-externas-container {
    max-width: 1184px;
    margin: 30px auto;
    padding: 0;
}
.opiniones-content-wrapper {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.12);
    padding: 40px;
}
.opiniones-content-wrapper h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}
.ml-rating-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}
.big-rating { font-size: 48px; font-weight: 600; color: #333; }

/* Estrellas grandes resumen: Tamaño mayor */
.ml-rating-summary .stars-static .star { 
    width: 24px; height: 24px; /* Un poco más grandes aquí */
}
.count-rating { color: #999; font-size: 14px; }

.opinion-item-row {
    padding-bottom: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
}
.opinion-item-row:last-child { border-bottom: none; margin-bottom: 0; }
.opinion-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

/* Estrellas reviews individuales: Tamaño menor */
.opinion-header .estrellas-php .star { 
    width: 14px; height: 14px; /* Tamaño normal */
}
.opinion-date { color: #999; font-size: 12px; }
.opinion-texto { font-size: 15px; color: #333; line-height: 1.5; margin-bottom: 10px; }
.opinion-footer-row { font-size: 13px; color: #666; display: flex; gap: 10px; align-items: center; }
.verificado { color: #00a650; font-size: 12px; }

/* FOTO DE PERFIL DE USUARIO */
.opinion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Redonda */
    object-fit: cover;
    margin-right: 5px;
    border: 1px solid #eee;
}

/* BOTÓN VER MÁS */
.btn-ver-todas {
    display: block;
    margin-top: 20px;
    background: none;
    border: none;
    color: var(--ml-blue);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
}
.btn-ver-todas:hover {
    color: var(--ml-blue-dark);
}

/* =======================================================
   ESTILOS LIGHTBOX (Full Screen Slider)
======================================================= */
.lightbox-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 9999; /* Por encima de todo */
    justify-content: center;
    align-items: center;
}

.lightboxSwiper {
    width: 100%;
    height: 100%;
}

.btn-close-lightbox {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000;
}

/* Color de flechas y paginación en el lightbox (blanco) */
.lightboxSwiper .swiper-button-next, 
.lightboxSwiper .swiper-button-prev {
    color: white !important;
    background: transparent;
    box-shadow: none;
}
.lightboxSwiper .swiper-pagination {
    color: white;
    bottom: 20px;
}

/* =================================================================
   RESPONSIVE (SOLO MÓVIL)
================================================================= */
@media (max-width: 999px) {
    .ml-main-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        box-shadow: none;
        padding-bottom: 0;
        /* EMPUJAR CONTENIDO PARA QUE EL HEADER NO TAPE LA FOTO (NI LA CORTE) */
        margin-top: 0px !important; 
    }

    .ml-header-mobile-only { 
        display: block !important; 
        padding: 16px 16px 0 16px; 
        order: 1; 
    }
    
    /* Ajuste de tamaño de estrellas en móvil */
    .ml-header-mobile-only .star {
        width: 16px; height: 16px;
    }
    
    .ml-col-gallery { 
        order: 2; 
        margin-top: 0; 
        padding: 0;
    }
    
    .ml-col-buybox { 
        order: 3; 
        padding: 16px; 
    }

    .ml-col-center { 
        order: 4; 
        border-top: 1px solid #eee; 
        padding: 16px; 
    }

    .ml-header-desktop { display: none; }
    .ml-thumbs-desktop { display: none !important; }
    
    .ml-gallery-wrapper { height: auto; display: block; }
    .mainSwiper { height: 350px; } /* Altura fija para el slider en móvil */
    .ml-card-buybox { border: none; padding: 0; }
    
    .opiniones-externas-container { padding: 16px; }
    .opiniones-content-wrapper { padding: 20px; }
}