/*  Productos.css -- Sith   */

:root {
    --color-primario: #0d6efd;
    --color-secundario: #1d4ed8;
    --texto-activo: #fff;
    --fondo-secciones: #f8fafc;
    --gris-tabs: #F7FAFC;
    --gris-borde: #dee2e6;
}

/*      Hero - Productos      */
.hero-productos {
    height: clamp(250px, 40vh, 400px);
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.4)),
                url('../img/optimized/productos/hero-productos.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    color: white;
    max-width: min(800px, 90%);
    margin: 20px auto;
    animation: fadeInUp 1s ease-out 0.3s;
}

.lead {
    margin-top: 0;
    padding-top: 0;
}

/*      Productos Grid      */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Línea vertical solo en desktop */
@media (min-width: 769px) {
    .productos-grid {
        grid-template-columns: 1fr 1fr;
        height: clamp(400px, 50vh, 600px);
    }

    .productos-grid::before {
        content: '';
        position: absolute;
        background-color: rgba(0, 0, 0, 0.1);
        width: 2px;
        height: 70%;
        left: 0;
        right: 0;
        margin: 0 auto;
        z-index: 1;
        pointer-events: none;
    }
}

/* Eliminar línea vertical en móvil */
@media (max-width: 768px) {
    .productos-grid::before {
        display: none;
    }
}

.productos-item {
    position: relative;
    overflow: hidden;
    border-radius: clamp(5px, 1vw, 8px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    aspect-ratio: 16/9;
}

.productos-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.productos-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    filter: brightness(0.9);
}

.productos-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.productos-item:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.productos-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: clamp(1rem, 2vw, 1.5rem);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.productos-item:hover .productos-overlay {
    opacity: 1;
}

.productos-overlay h3 {
    margin: 0 0 clamp(0.5rem, 1vw, 1rem) 0;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

/*      Tabs - Sección Interna Productos      */
.menu-interno {
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.titulo-productos {
    text-align: center;
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
    color: #fff;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.titulo-productos::after {
    content: "";
    display: block;
    width: clamp(60px, 8vw, 80px);
    height: 4px;
    background: var(--color-primario);
    margin: 0.5rem auto;
    border-radius: 2px;
}

.subtitulo-productos {
    text-align: center;
    color: #f8f8f8;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    margin-bottom: 2rem;
    font-weight: 500;
}

/*      Tabs (Desktop) - MODIFICADO CON FONDO GRIS      */
.tabs-container {
    display: flex;
    flex-wrap: wrap;
    position: relative;
    border-bottom: 2px solid var(--gris-borde);
    align-items: center;
    gap: 3px;
    justify-content: flex-start;
    padding: 0.4rem 0;
    background: #F8F9FA;
    border-radius: 8px 8px 0 0;
}

.home-icon {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    background: var(--gris-tabs);
    border-radius: 5px;
    border: 1px solid var(--gris-borde);
    margin: 1px;
    text-align: center;
    min-width: max-content;
    font-size: 0.9rem;
}

.home-icon:hover {
    transform: scale(1.05);
    color: var(--color-secundario);
    background: #e9ecef;
}

.tab {
    padding: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    background: var(--gris-tabs);
    border-radius: 5px;
    border: 1px solid var(--gris-borde);
    margin: 2px;
    text-align: center;
    min-width: max-content;
}

.tab:hover {
    color: var(--color-secundario);
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab.active {
    color: white;
    background: var(--color-primario);
    border-color: var(--color-primario);
}

.liquid-indicator {
    position: absolute;
    bottom: -2px;
    height: 3px;
    background: var(--color-primario);
    border-radius: 3px 3px 0 0;
    transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 2;
}

/*      Contenido Dinámico      */
.dynamic-content {
    display: none;
    padding: clamp(1rem, 2vw, 2rem);
    background: var(--fondo-secciones);
    border-radius: 0 0 8px 8px;
    animation: fadeIn 0.5s ease;
}

.dynamic-content.active {
    display: block;
}

/*      Banner Productos      */
.home-banner {
    width: 100%;
    height: clamp(250px, 30vw, 400px);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.home-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 5s ease;
}

.home-banner:hover img {
    transform: scale(1.05);
}

.banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: clamp(1rem, 2vw, 2rem);
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

/*      Detalle Producto      */
.detail-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    margin-bottom: 3rem;
}

.detail-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.detail-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    transition: transform 0.5s ease;
    display: block;
}

.detail-image:hover img {
    transform: scale(1.05);
}

.detail-text h2 {
    color: #1e293b;
    margin-bottom: 1rem;
    margin-top: 0;
}

/*      Productos Relacionados      */
.related-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1rem, 1.5vw, 1.5rem);
    max-width: 1400px; /* LÍMITE MÁXIMO AÑADIDO */
    margin: 0 auto; /* CENTRADO AÑADIDO */
}

.product-card {
    height: auto;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.product-image {
    aspect-ratio: 3/2; /* Ratio 300x200 = 3:2 */
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ASEGURAR QUE NO HAYA EFECTO EN HOVER */
.product-card:hover img {
    transform: none !important;
    filter: none !important;
}

.product-info {
    padding: clamp(0.75rem, 1vw, 1rem);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.product-desc {
    font-size: clamp(0.75rem, 0.85vw, 0.85rem);
    color: #333;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.product-features {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.product-features li {
    color: #333;
    position: relative;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    margin-bottom: 0.3rem;
    padding-left: 1.2rem;
}

.product-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.3rem;
    height: 0.3rem;
    background-color: #cc0000;
    border-radius: 50%;
}

/*      PDF      */
.pdf-container {
    margin-top: auto;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.pdf-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    text-decoration: none;
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    transition: all 0.3s ease;
}

.pdf-icon i {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
}

.pdf-icon:hover {
    color: #dc2626;
    transform: translateY(-2px);
}

.pdf-icon:active {
    transform: scale(0.95);
}

/*      Submenú Interactivo      */
.submenu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.submenu-item {
    padding: 0.75rem;
    border-radius: 6px;
    color: #334155;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #fff;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    border: none;
}

.submenu-item:hover {
    background: #e0e7ff;
    color: var(--color-primario);
    transform: translateX(5px);
}

.submenu-item.active {
    background: var(--color-primario);
    color: white;
}

.submenu-item.active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--color-primario);
    border-radius: 3px;
}

/*      Animaciones      */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/*      Responsive Mobile      */
@media (max-width: 768px) {
    .tabs-container {
        display: flex;
        flex-wrap: nowrap; /* Cambia de wrap a nowrap */
        overflow-x: auto; /* Scroll horizontal */
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        padding: 0.5rem 0.75rem; /* Padding lateral para no pegarse a los bordes */
        justify-content: flex-start;
        white-space: nowrap;
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: var(--color-primario) #f1f1f1;
        gap: 4px; /* Espacio entre tabs */
        border-radius: 8px;
        background: #f8f9fa;
        margin: 0 -0.5rem; /* Compensa padding del contenedor */
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Scrollbar personalizada */
    .tabs-container::-webkit-scrollbar {
        height: 4px;
    }

    .tabs-container::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.05);
        border-radius: 2px;
        margin: 0 0.5rem;
    }

    .tabs-container::-webkit-scrollbar-thumb {
        background: var(--color-primario);
        border-radius: 2px;
    }

    .tabs-container::-webkit-scrollbar-thumb:hover {
        background: var(--color-secundario);
    }

    .home-icon, .tab {
        flex: 0 0 auto; /* No crece, no se encoge, tamaño automático */
        white-space: nowrap;
        padding: 0.5rem 0.8rem; /* Tamaño compacto */
        font-size: 0.85rem;
        margin: 0;
    }

    .home-icon {
        margin-right: 4px;
    }

    /* Indicador líquido - opcional ocultar en móvil */
    .liquid-indicator {
        display: none; /* Ocultar en móvil para mejor performance */
    }

    /* Feedback visual al hacer scroll */
    .tabs-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, #f8f9fa);
        pointer-events: none;
    }

    .productos-item {
        aspect-ratio: 4/3;
    }

    .productos-overlay {
        padding: 0.75rem;
    }

    .productos-overlay h3 {
        font-size: 1.1rem;
    }

    .related-products {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .submenu {
        grid-template-columns: 1fr;
    }

    .home-banner {
        height: 200px;
    }

    .detail-container {
        grid-template-columns: 1fr;
    }
}

/*      Mobile Pequeño      */
@media (max-width: 480px) {
    .hero-productos {
        height: 200px;
    }

    .productos-grid {
        gap: 1rem;
    }

    .productos-overlay h3 {
        font-size: 1rem;
    }

    .tab {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .home-icon {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .tabs-container {
        padding: 0.4rem 0.5rem;
        gap: 3px;
    }

    .home-icon, .tab {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
}

/*      Mejora para tablets      */
@media (min-width: 769px) and (max-width: 1024px) {
    .tabs-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.3rem;
    }

    .home-icon, .tab {
        flex-shrink: 0;
    }
}

/* En pantallas muy grandes, no dejar que se estiren demasiado */
@media (min-width: 1400px) {
    .product-card {
        max-width: 320px;
        justify-self: center; /* Centrar individualmente */
    }
}