/*
 * --------------------------------
 * VARIABLES Y RESET BÁSICO
 * --------------------------------
 */
:root {
    --color-primary: #000;          /* Negro (Para Navbar y textos principales) */
    --color-secondary: #5cb85c;     /* Verde claro (Para botones/acento, como en "tienda.jpg") */
    --color-text-light: #666;       /* Gris claro para textos secundarios */
    --color-background: #f8f8f8;    /* Fondo muy claro */
    --font-family-base: Arial, sans-serif;
    --max-width-container: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--color-primary);
    background-color: #fff;
}

/*
 * --------------------------------
 * ENCABEZADO Y NAVEGACIÓN (Navbar)
 * Estilo basado en la barra negra de "tienda.jpg"
 * --------------------------------
 */
header {
    background-color: var(--color-primary);
    color: #fff;
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-secondary); /* Detalle de acento */
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--color-secondary);
}

/* Estilo específico para el botón del carrito */
#btnCarrito {
    background-color: transparent;
    border: 1px solid #fff;
    padding: 8px 15px;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
}

#btnCarrito:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

/*
 * --------------------------------
 * SECCIONES GENERALES
 * --------------------------------
 */
section {
    padding: 20px 2%;
    max-width: var(--max-width-container);
    margin: 0 auto;
}

h2 {
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
/* Altura controlada para el slider */
.banner-img {
    height: 450px;
    object-fit: contain; /* Importante para que fotos de distintos tamaños encajen */
    width: 100%;
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .banner-img {
        height: 250px;
    }
    .carousel-caption {
        display: block !important; /* Mostramos el texto también en móvil */
        bottom: 10px;
        padding: 10px !important;
    }
    .carousel-caption h2 {
        font-size: 1.2rem;
    }
    .carousel-caption p {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
}
/*
 * --------------------------------
 * CATEGORÍAS (Filtros)
 * --------------------------------
 */
 #categorias{
    display: flex;
 }
.categorias-container {
    margin-left: 50px;
    text-align: center;
    margin-bottom: 30px;
}

.cat-btn {
    background-color: #fff;
    color: var(--color-primary);
    border: 1px solid #ccc;
    padding: 10px 15px;
    margin: 5px;
    cursor: pointer;
    font-size: 1em;
    border-radius: 3px;
    transition: all 0.3s;
}

.cat-btn:hover,
.cat-btn.active {
    background-color: var(--color-secondary); /* Verde de acento */
    color: white;
    border-color: var(--color-secondary);
}
/* --- ESTILOS DE CATEGORÍAS --- */

/* Por defecto, ocultamos el select de móvil */
.cat-select-mobile {
    display: none;
    width: 100%;
    padding: 10px 0;
}

#catSelector {
    width: 95%;
    padding: 8px;
    font-size: 16px;
    border: 2px solid var(--color-secondary); /* Color azul característico */
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    outline: none;
    cursor: pointer;
}

/* Contenedor de botones escritorio */
.cat-buttons-desktop {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* --- RESPONSIVE --- */

@media (max-width: 768px) {
    .categorias-container{
        display: none;
    }
    /* Ocultamos los botones horizontales */
    .cat-buttons-desktop {
        display: none;
    }

    /* Mostramos el desplegable */
    .cat-select-mobile {
        display: block;
        margin-left: 10px;
    }

    #categorias h2 {
        text-align: left;
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
}
/*
 * --------------------------------
 * LISTADO DE PRODUCTOS
 * Secciones que se generan por JS
 * --------------------------------
 */
.productos-container {
    display: flex;
    /* grid-template-columns: repeat(auto-fit, minmax(200px, .5fr)); */
    gap: 15px;
    padding: 20px 0;
}

.producto-card {
    width: 300px;
    height: auto;
    background-color: #fff;
    border: 1px solid #eee;
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.producto-card img {
    width: 150px;
    /* height: 25%; */
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.producto-card h3 {
    font-size: 1em;
    margin-bottom: 10px;
}
.producto-card h3:hover {
    color: var(--color-secondary);
}

.productos img{
    width: 250px;
}
.precio {
    color: #d9534f; /* Color llamativo para el precio */
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    display: block;
}

/* Estilo para botones de acción (Agregar al Carrito) */
.btn {
    background-color: var(--color-secondary); /* Verde de la imagen */
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #4cae4c;
}

/*
 * --------------------------------
 * MODAL DE DETALLE
 * --------------------------------
 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
   
}

/* --- ESTILOS GENERALES PARA TODOS LOS MODALES --- */
.modal-overlay {
    display: none; /* Se activa con JS (flex) */
    position: fixed;
    z-index: 2000; /* Por encima de todo */
    left: 0;
    top: 20px;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo más oscuro para enfoque */
    
    /* Centrado perfecto */
    align-items: center; 
    justify-content: center;
    padding: 20px; /* Margen para móviles */
}

.modal-content {
    background-color: #fff;
    width: 100%;
    /* max-width: 700px; Tamaño optimizado */
    margin: 20px auto;
    border-radius: 12px;
    padding: 25px;
    position: relative;
    
    /* SOLUCIÓN AL FONDO QUE SE CORTA */
    max-height: 90vh; /* No permite que el modal sea más alto que la pantalla */
    overflow-y: auto; /* Permite scroll interno si el texto es muy largo */
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}
.modal-checkout{
    width: 50%;
    height: auto;
     border: 5px solid var(--color-secondary);
}

#modalImg {
    max-width: 60%;
    height: auto;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

.close-facturacion{
   right: 50px; 
   z-index: 3000;
}

.close:hover,
.close:focus {
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
}

#btnAgregarCarrito {
    margin-top: 15px;
    width: 80%;
    max-width: 300px;
}

/*
 * --------------------------------
 * CARRITO LATERAL (Panel)
 * --------------------------------
 */
.carrito-panel {
    height: 100%;
    width: 350px;
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    background-color: #fff;
    overflow-x: hidden;
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%); /* Inicialmente oculto */
    border-left: 5px solid var(--color-secondary);
}

.carrito-panel.open {
    transform: translateX(0); /* Muestra el carrito */
}

.carrito-panel h3 {
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#listaCarrito {
    list-style: none;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

#listaCarrito li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
}

.carrito-panel p {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
}

.carrito-panel .btn {
    width: 100%;
    margin-top: 15px;
}

.close-cart {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    margin-top: 10px;
    display: block;
    width: 100%;
    text-align: center;
}

.close-cart:hover {
    color: var(--color-primary);
}

.close {
     color: #e94242;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    cursor: pointer;
    z-index: 10;
}

/* estilos de detalle producto */
/* ==========================================================
   CONFIGURACIÓN BÁSICA
   ========================================================== */

a {
    text-decoration: none;
    color: #3483fa; /* Color de enlace azul de Mercado Libre */
}

/* Contenedor principal de la página */
.product-detail-container {
    background: #fff;
    width: 95%;
    max-width: 1100px;
    margin: auto;
    border-radius: 8px;
    position: relative;
    padding: 20px;
}

/* ==========================================================
   ENCABEZADO Y GRILLEADO PRINCIPAL
   ========================================================== */

/* Estilo para la información superior (Nuevo | +5mil vendidos) */

/* Layout principal de 3 columnas (Galería | Info | Compra) */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 350px; /* Columna de info y columna de compra */
    gap: 30px;
}

/* ==========================================================
   1. COLUMNA GALERÍA (IZQUIERDA)
   ========================================================== */
.product-image-large {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
    margin: 20px auto;
    object-fit: contain;
}

/* ==========================================================
   2. COLUMNA INFORMACIÓN (CENTRO)
   ========================================================== */
.column-info {
    padding-right: 20px;
    border-right: 1px solid #eee; /* Línea separadora sutil a la derecha */
}

.product-title {
    font-size: 24px;
    font-weight: 400; /* Fuente no tan pesada */
    margin: 0 0 10px 0;
}

/* Sección de Calificación */
.rating-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.rating-value {
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

.stars {
    color: #ffc107; /* Amarillo para las estrellas */
    margin-right: 5px;
}

.review-count {
    color: #3483fa;
}

/* Precios */
.price-original {
    text-decoration: line-through;
    color: #888;
    font-size: 16px;
    margin-bottom: 5px;
}

.price-section {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.price-section .price-final {
    font-size: 36px;
    font-weight: 600; /* Fuente ligera */
    color:#d9534f;
    margin-right: 10px;
}

/* Variantes (Color) */
.variants-section {
    margin-bottom: 30px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.variant-label {
    font-size: 16px;
    margin-bottom: 10px;
}

.color-option {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 1px solid #ccc;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
}

.color-option.active {
    border-color: #3483fa; /* Borde azul para la opción seleccionada */
    border-width: 2px;
}

.color-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Ficha Técnica / Especificaciones */
.caracteristicas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}
.specs-section h2 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 15px;
}

.specs-section ul {
    list-style: none;
    padding: 0;
}

.specs-section ul li {
    font-size: 14px;
    margin-bottom: 5px;
    /* Simula el punto de la lista con un ::before */
    padding-left: 15px;
    position: relative;
}

.specs-section li::before {
    content: "•";
    color: #333;
    font-size: 16px;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}


/* ==========================================================
   3. COLUMNA CHECKOUT / COMPRA (DERECHA)
   ========================================================== */
.column-checkout-options {
    /* Hace que la barra lateral de compra se quede fija mientras scrolleas */
    position: sticky;
    top: 20px; 
    align-self: flex-start; /* Evita que se estire */
}

/* Stock */
.stock-info {
    border-top: 1px solid #eee;
    padding: 15px 0;
    margin-bottom: 15px;
}

.stock-info h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.quantity-value {
    font-weight: bold;
}

.limit-message {
    font-size: 12px;
    color: #888;
}
.seller-icon{
    width: 10%;
    border-radius: 100%;
}

/*   BOTONES   */
.btn-primary {
    background-color: #3483fa; /* Azul principal */
    color: white;
}

.btn-primary:hover {
    background-color: #2968c8;
}

.btn-secondary {
    width: 100%;
    background-color: #b6f8bc; /* verdde muy claro */
    color:--color-secondary;
    border: 1px solid --color-secondary;
}

.btn-secondary:hover {
    background-color: --color-secondary;
}

/* Vendedor / Tienda Oficial */

.verified-badge {
    color: #3483fa;
    font-size: 12px;
    margin-right: 5px;
}

.seller-reputation {
    display: block;
    width: 100%; /* Ocupa toda la línea debajo del nombre */
    color: #00a650;
    font-size: 12px;
    margin-top: 2px;
    margin-bottom: 5px;
}

.invoice-info {
    font-size: 12px;
    color: #888;
}

/* Devolución */
.return-policy {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #333;
}

/*
 * --------------------------------
 * Estilos del Stepper (Pasos)
 * --------------------------------
 */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}
.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}
.stepper-item::before {
    content: "";
    position: absolute;
    top: 15px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #ccc;
    z-index: -1;
}
.stepper-item:first-child::before { content: none; }

.step-counter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #ccc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.stepper-item.active .step-counter { background: #3483fa; }
.stepper-item.active .step-name { color: #3483fa; font-weight: bold; }

/* Formularios y Botones */
.step-section h3 { margin-bottom: 20px; color: #333; }
.input-group { margin-bottom: 15px; }
.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.btn-group { display: flex; gap: 10px; margin-top: 20px; }
.btn-next, .btn-primary { background-color: #3483fa; color: white; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; flex: 1; }
.btn-back { background-color: #eee; color: #666; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; }

/* --- ESTILOS DEL MENÚ HAMBURGUESA --- */

/* Oculto por defecto en escritorio */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #00a650; /* Color de las rayitas */
    transition: all 0.3s ease;
}

/* --- MEDIA QUERY PARA MÓVILES (Max 768px) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; /* Aparece el ícono */
        z-index: 1001;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%; /* Escondido a la derecha */
        width: 70%;
        height: 100vh;
        background-color: #000; /* Fondo negro como tu header */
        transition: 0.4s;
        padding-top: 80px;
        z-index: 1000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }

    /* Clase que activaremos con JS */
    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    nav ul li a {
        font-size: 1.2rem;
    }

    /* Animación de la hamburguesa a una "X" */
    #mobile-menu.active .bar:nth-child(2) { opacity: 0; }
    #mobile-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); color:--color-secondary;}
    #mobile-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); color:--color-secondary;}
}


/*
 * --------------------------------
 * RESPONSIVE
 * --------------------------------
 */
 /* --- MEDIA QUERIES PARA MÓVILES --- */
@media (max-width: 850px) {
    .main-content-grid {
        grid-template-columns: 1fr; /* Una sola columna */
    }

    .product-detail-container {
        width: 100%;
        height: 100%; /* Ocupa toda la pantalla en móvil si es necesario */
        border-radius: 0;
        overflow-y: auto;
    }

    .caracteristicas {
        grid-template-columns: 1fr; /* Características una debajo de otra */
    }

    .column-checkout-options {
        border: 1px solid #eee;
        padding: 15px;
        border-radius: 8px;
        margin-top: 20px;
    }

    .product-title {
        font-size: 1.4rem;
    }
}
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 5px 10px;
    }

    .productos-container {
        grid-template-columns: 1fr;
    }
    
    .carrito-panel {
        width: 100%; /* Ocupa todo el ancho en móvil */
        z-index: 101;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}