/* =================================================================
   ESTILOS MODERNOS PARA COQUICOOL PWA
   ================================================================= */

/* Header Moderno */
.modern-header {
    background: var(--gradient-primary);
    padding: var(--space-4) 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-logo {
    height: 60px;
    width: auto;
    transition: var(--transition-normal);
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.8));
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
}

.modern-logo:hover {
    transform: scale(1.05);
}

/* Sección de Productos */
.products-section {
    padding: var(--space-12) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    background: var(--gradient-tropical);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--neutral-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Grid de Productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-8);
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-10);
    }
}

/* Tarjetas de Producto */
.product-card {
    background: var(--neutral-0);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-normal);
    position: relative;
    transform-origin: center;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: var(--gradient-sunset);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.product-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.product-info {
    padding: var(--space-6);
}

.product-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--neutral-800);
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.product-description {
    color: var(--neutral-600);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.product-price {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--primary-600);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Símbolo $ removido - se muestra desde PHP */

/* Estados de Error */
.error {
    background: linear-gradient(135deg, var(--error), #d32f2f);
    color: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    text-align: center;
    margin: var(--space-8) 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.error::before {
    content: '⚠️';
    font-size: var(--text-2xl);
    display: block;
    margin-bottom: var(--space-2);
}

.error::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Footer Moderno */
footer {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: var(--space-12) 0;
    margin-top: var(--space-20);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

footer .container {
    position: relative;
    z-index: 1;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-logo {
    height: 32px;
    filter: brightness(0) invert(1);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.footer-brand {
    font-family: var(--font-secondary);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.footer-text {
    margin: 0;
    font-size: var(--text-sm);
    opacity: 0.9;
}

.footer-tagline {
    margin: var(--space-2) 0 0;
    font-size: var(--text-xs);
    opacity: 0.7;
    font-style: italic;
}

/* Animaciones de Entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-scale {
    animation: fadeInScale 0.4s ease-out;
}

/* Animaciones escalonadas para las tarjetas */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* Efectos de Scroll */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: var(--transition-slow);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design Mejorado */
@media (max-width: 768px) {
    .modern-header {
        padding: var(--space-3) 0;
    }
    
    .modern-logo {
        height: 45px;
    }
    
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .section-subtitle {
        font-size: var(--text-base);
        padding: 0 var(--space-4);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        padding: 0 var(--space-2);
    }
    
    .product-card {
        border-radius: var(--radius-xl);
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-info {
        padding: var(--space-4);
    }
    
    .product-title {
        font-size: var(--text-lg);
    }
    
    .product-price {
        font-size: var(--text-xl);
    }
    
    footer {
        margin-top: var(--space-12);
        padding: var(--space-8) 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .product-image-container {
        height: 250px;
    }
}

/* Estados de Carga específicos */
.product-card.loading {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.9;
    }
}

/* Efectos de Foco */
.product-card:focus-within {
    outline: 3px solid var(--primary-300);
    outline-offset: 2px;
}

/* Optimizaciones de Performance */
.product-image {
    will-change: transform;
}

.product-card {
    will-change: transform, box-shadow;
}

/* Forzar tema claro siempre para productos */
.product-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important;
}

.product-title {
    color: #1e293b !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}

.product-description {
    color: #475569 !important;
}

.product-info {
    background: #ffffff !important;
}

.product-price {
    color: #059669 !important;
    text-shadow: none !important;
}

/* Mejorar contraste en todos los elementos del producto */
.product-badge {
    background: #4ade80 !important;
    color: #166534 !important;
    font-weight: 700 !important;
}

.product-footer {
    background: #ffffff !important;
    padding-top: var(--space-2);
    border-top: 1px solid #f1f5f9;
}

/* Asegurar que los botones tengan buen contraste */
.add-to-cart {
    background: #059669 !important;
    color: #ffffff !important;
    border: 2px solid #059669 !important;
}

.add-to-cart:hover {
    background: #047857 !important;
    border-color: #047857 !important;
    transform: translateY(-2px) !important;
}