/* ============================================
   PRODUCTOS.CSS - Hero Aurora Flow + Resto de estilos
   ============================================ */

/* ============================================
   1. PAGE HEADER COMPACTO CON AURORA FLOW
   Basado en NOSOTROS.CSS para estandarizar
   ============================================ */

.page-header {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 72px;
    background: linear-gradient(135deg, #0082C2 0%, #009BA8 100%);
}

/* Wrapper para contener la imagen dentro del header con efecto empotrado */
.page-header-image {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 5; /* Por encima de las auroras */
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

/* La imagen con efecto de profundidad empotrado solo en los lados */
.page-header-image img {
    width: 50%;
    max-width: calc(1200px * 0.50);
    height: 100%;
    object-fit: cover;
    margin-right: calc((100vw - 1200px) / 2);
    border-radius: 12px 0 0 12px; /* Solo redondeo en el lado izquierdo */

    /* Sombra interna para efecto empotrado en los lados */
    box-shadow:
            inset 3px 0 12px rgba(0, 0, 0, .35),
            inset 8px 0 20px rgba(0, 0, 0, .2),
            inset -2px 0 8px rgba(0, 0, 0, .15),
            -2px 0 8px rgba(0, 0, 0, .3);

    /* Borde sutil para definir los bordes laterales */
    border-left: 2px solid rgba(255, 255, 255, .15);
    border-right: 2px solid rgba(0, 0, 0, .2);

    position: relative;
}

/* En pantallas menores al container, corregimos el margen derecho */
@media (max-width: 1240px) {
    .page-header-image img {
        margin-right: 20px;
    }
}

/* Aurora Gradient Animado (cubre todo el ancho como en nosotros.css) */
.page-header-aurora {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.aurora-layer {
    position: absolute;
    width: 200%;
    height: 200%;
    opacity: 0.6;
    mix-blend-mode: screen;
    filter: blur(60px);
}

.aurora-layer-1 {
    background: radial-gradient(circle at 30% 50%, #0082C2 0%, transparent 50%);
    animation: aurora-flow-1 12s ease-in-out infinite;
}

.aurora-layer-2 {
    background: radial-gradient(circle at 70% 30%, #009BA8 0%, transparent 50%);
    animation: aurora-flow-2 15s ease-in-out infinite;
}

.aurora-layer-3 {
    background: radial-gradient(circle at 50% 70%, #00C2B8 0%, transparent 50%);
    animation: aurora-flow-3 18s ease-in-out infinite;
}

@keyframes aurora-flow-1 {
    0%, 100% { transform: translate(-20%, -20%) scale(1); }
    50% { transform: translate(10%, 10%) scale(1.1); }
}

@keyframes aurora-flow-2 {
    0%, 100% { transform: translate(10%, 10%) scale(1); }
    50% { transform: translate(-20%, -10%) scale(1.15); }
}

@keyframes aurora-flow-3 {
    0%, 100% { transform: translate(0%, 15%) scale(1); }
    50% { transform: translate(15%, -15%) scale(1.1); }
}

/* Partículas flotantes */
.page-header-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particle-float 8s ease-in-out infinite;
}

.particle:nth-child(1) {
    left: 35%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 6s;
}

.particle:nth-child(2) {
    left: 50%;
    top: 60%;
    animation-delay: 1s;
    animation-duration: 8s;
}

.particle:nth-child(3) {
    left: 70%;
    top: 30%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.particle:nth-child(4) {
    left: 85%;
    top: 70%;
    animation-delay: 1.5s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    left: 60%;
    top: 80%;
    animation-delay: 0.5s;
    animation-duration: 7.5s;
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-30px) translateX(10px);
        opacity: 0;
    }
}

/* Contenido del header */
.page-header-content {
    position: relative;
    z-index: 4;
    color: var(--color-white);
}

/* Breadcrumb estandarizado */
.page-breadcrumb {
    margin-bottom: 12px;
}

.page-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.page-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
}

.page-breadcrumb li:not(:last-child)::after {
    content: ">";
    font-size: 14px;
    opacity: 0.6;
}

.page-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 200ms ease;
    position: relative;
}

.page-breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 200ms ease;
}

.page-breadcrumb a:hover {
    color: rgba(255, 255, 255, 1);
}

.page-breadcrumb a:hover::after {
    width: 100%;
}

.page-breadcrumb li[aria-current="page"] {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

/* Título principal */
.page-header-title {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0,0,0,.15);
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%,100%{ text-shadow:0 2px 20px rgba(0,0,0,.15);}
    50%{ text-shadow:0 2px 30px rgba(255,255,255,.2);}
}

.page-header-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255,255,255,.9);
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Líneas decorativas */
.page-header-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0.3;
}

.deco-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    height: 1px;
}

.deco-line-1 {
    top: 30%;
    left: 30%;
    right: 0;
    animation: line-expand 4s ease-in-out infinite;
}

.deco-line-2 {
    bottom: 35%;
    left: 35%;
    right: 0;
    animation: line-expand 4s ease-in-out infinite 2s;
}

@keyframes line-expand {
    0%, 100% {
        transform: scaleX(0.8);
        opacity: 0.2;
    }
    50% {
        transform: scaleX(1);
        opacity: 0.4;
    }
}

/* ============================================
   2. FILTROS
   ============================================ */

.filters-section {
    padding: var(--space-6) 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-light);
    position: sticky;
    top: 72px;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-wrapper {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-brand-blue) var(--color-gray-light);
}

.filters-wrapper::-webkit-scrollbar {
    height: 4px;
}

.filters-wrapper::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 2px;
}

.filters-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-brand-blue);
    border-radius: 2px;
}

.filter-btn {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-5);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-gray);
    background: var(--color-white);
    border: 2px solid var(--color-gray-light);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--color-brand-blue);
    color: var(--color-brand-blue);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-brand);
    color: var(--color-white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 130, 194, 0.3);
}

/* ============================================
   3. GRID DE PRODUCTOS
   ============================================ */

.products-section {
    padding: var(--space-9) 0;
    background: var(--color-gray-bg);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

/* ============================================
   4. PRODUCT CARD
   ============================================ */

.product-card {
    background: var(--color-white);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-base);
    transition: all var(--duration-slow) ease;
    opacity: 1;
    transform: translateY(0);
}

.product-card.reveal {
    opacity: 0;
    transform: translateY(24px);
}

.product-card.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Filtro oculto */
.product-card.hidden {
    display: none;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Imagen del producto */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slower) ease;
}

.product-card:hover .product-image {
    transform: scale(1.0);
}

/* Badge */
.product-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2;
}

.product-badge span {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-white);
    background: var(--gradient-brand);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 130, 194, 0.4);
}

/* Overlay hover */
.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
            135deg,
            rgba(0, 130, 194, 0.9) 0%,
            rgba(0, 155, 168, 0.9) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
    z-index: 1;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.btn-overlay {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid var(--color-white);
    border-radius: var(--radius-base);
    transition: all var(--duration-normal) ease;
    transform: translateY(10px);
}

.product-card:hover .btn-overlay {
    transform: translateY(0);
}

.btn-overlay:hover {
    background: var(--color-white);
    color: var(--color-brand-blue);
}

/* Contenido del producto */
.product-content {
    padding: var(--space-6);
}

.product-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.product-description {
    font-size: var(--font-body-m);
    color: var(--color-gray);
    line-height: 1.6;
    margin-bottom: var(--space-4);
}

/* Features list */
.product-features {
    margin-bottom: var(--space-5);
    padding-left: var(--space-4);
}

.product-features li {
    position: relative;
    font-size: 14px;
    color: var(--color-gray);
    line-height: 1.6;
    margin-bottom: var(--space-2);
    padding-left: var(--space-4);
}

.product-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--color-brand-teal);
    border-radius: 50%;
}

/* Acciones */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.product-actions .btn {
    width: 100%;
    justify-content: center;
}

/* ============================================
   5. SECCIÓN VENTAJAS
   ============================================ */

.advantages-section {
    padding: var(--space-9) 0;
    background: var(--color-white);
}

.advantages-header {
    margin-bottom: var(--space-8);
}

.advantages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    max-width: 1100px;
    margin: 0 auto;
}

.advantage-card {
    text-align: center;
    padding: var(--space-6);
    background: var(--color-gray-bg);
    border-radius: var(--radius-large);
    transition: all var(--duration-slow) ease;
}

.advantage-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.advantage-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-brand);
    border-radius: 50%;
    color: var(--color-white);
}

.advantage-title {
    font-size: var(--font-body-l);
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: var(--space-3);
}

.advantage-description {
    font-size: var(--font-body-m);
    color: var(--color-gray);
    line-height: 1.6;
}

/* ============================================
   6. CTA PRODUCTOS
   ============================================ */

.cta-products-section {
    padding: var(--space-9) 0;
    background: var(--color-gray-bg);
}

.cta-products-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.cta-products-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: var(--space-4);
    line-height: 1.3;
}

.cta-products-subtitle {
    font-size: var(--font-body-l);
    color: var(--color-gray);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.cta-products-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}

/* ============================================
   7. RESPONSIVE - MOBILE (max 767px)
   ============================================ */

@media (max-width: 767px) {
    .page-header {
        height: 160px;
    }

    /* Igual que en nosotros.css: ajustamos la imagen, no el wrapper */
    .page-header-image img {
        width: 40%;
        margin-right: 15px;
    }

    .page-header-title {
        font-size: 32px;
    }

    .page-header-subtitle {
        font-size: 14px;
    }

    /* Mantienes tu mejora de performance en mobile */
    .particle {
        display: none; /* Ocultar partículas en móvil para mejor performance */
    }
}

/* ============================================
   8. RESPONSIVE - TABLET (768px+)
   ============================================ */

@media (min-width: 768px) {
    .page-header {
        height: 200px;
    }

    .page-header-title {
        font-size: 48px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .product-actions {
        flex-direction: row;
    }

    .product-actions .btn {
        width: auto;
        flex: 1;
    }

    .cta-products-actions {
        flex-direction: row;
        justify-content: center;
    }

    .cta-products-title {
        font-size: 40px;
    }
}

/* ============================================
   9. RESPONSIVE - DESKTOP (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    .page-header {
        height: 220px;
    }

    .page-header-title {
        font-size: 42px;
    }

    .page-header-subtitle {
        font-size: 14px;
    }

    .filters-wrapper {
        justify-content: center;
        flex-wrap: wrap;
        overflow: visible;
    }

    .advantages-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-5);
    }

    .cta-products-title {
        font-size: 48px;
    }
}

/* ============================================
   10. RESPONSIVE - LARGE DESKTOP (1200px+)
   ============================================ */

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   11. ANIMACIONES PERSONALIZADAS
   ============================================ */

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card.reveal.active {
    animation: fadeInScale 600ms ease-out backwards;
}

/* Delay escalonado para cards */
.product-card:nth-child(1) { animation-delay: 0ms; }
.product-card:nth-child(2) { animation-delay: 100ms; }
.product-card:nth-child(3) { animation-delay: 200ms; }
.product-card:nth-child(4) { animation-delay: 300ms; }
.product-card:nth-child(5) { animation-delay: 400ms; }
.product-card:nth-child(6) { animation-delay: 500ms; }
.product-card:nth-child(7) { animation-delay: 600ms; }
.product-card:nth-child(8) { animation-delay: 700ms; }

/* ============================================
   12. ACCESIBILIDAD Y MOTION REDUCIDO
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .page-header-aurora,
    .particle,
    .deco-line,
    .page-header-title,
    .product-card,
    .advantage-card,
    .product-image,
    .btn-overlay {
        transition: none;
        animation: none !important;
    }

    .product-card:hover {
        transform: none;
    }
}

/* Focus visible */
.filter-btn:focus-visible {
    outline: 3px solid var(--color-brand-blue);
    outline-offset: 2px;
}

.product-card:focus-within {
    outline: 3px solid var(--color-brand-blue);
    outline-offset: 4px;
}

/* ============================================
   FIN PRODUCTOS.CSS
   ============================================ */