/* ===== CSS CUSTOM PROPERTIES (THEMING) ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: rgba(0, 229, 255, 0.15);
    --border-hover: rgba(0, 229, 255, 0.4);
    --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.1);
    --shadow-card: 0 0 40px rgba(0, 229, 255, 0.12), 0 10px 40px rgba(0, 123, 255, 0.08);
    --nav-bg: transparent;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 229, 255, 0.1);
    --hero-bg: linear-gradient(135deg, #ffffff 0%, #f0f9ff 30%, #e0f7ff 60%, #ffffff 100%);
    --filter-bg: rgba(0, 229, 255, 0.08);
    --filter-active: linear-gradient(135deg, #00e5ff, #007bff);
    --filter-text: #00e5ff;
    --filter-text-active: #ffffff;
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --modal-bg: #ffffff;
    --section-divider: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.3), rgba(0, 123, 255, 0.3), transparent);
    --stat-bg: rgba(255, 255, 255, 0.05);
    --stat-border: rgba(255, 255, 255, 0.1);
    --footer-bg: #111827;
    --footer-text: #9ca3af;
}

[data-theme="dark"] {
    --bg-primary: #0b1120;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 229, 255, 0.1);
    --border-hover: rgba(0, 229, 255, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.05);
    --shadow-card: 0 0 40px rgba(0, 229, 255, 0.08), 0 10px 40px rgba(0, 123, 255, 0.05);
    --nav-bg: rgba(11, 17, 32, 0.9);
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(0, 229, 255, 0.08);
    --hero-bg: linear-gradient(135deg, #0b1120 0%, #0f172a 30%, #0b1120 60%, #0f172a 100%);
    --filter-bg: rgba(0, 229, 255, 0.06);
    --filter-text: #22d3ee;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --modal-bg: #0f172a;
    --section-divider: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.15), rgba(0, 123, 255, 0.15), transparent);
    --footer-bg: #020617;
    --footer-text: #64748b;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== HERO ===== */
.hero-bg {
    background: var(--hero-bg);
    position: relative;
    overflow: hidden;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}
.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

/* ===== GLASS ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}
.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
    transform: translateY(-8px);
}

.text-glow-cyan { text-shadow: 0 0 20px rgba(0, 229, 255, 0.5), 0 0 40px rgba(0, 229, 255, 0.2); }
.text-glow-blue { text-shadow: 0 0 20px rgba(0, 123, 255, 0.5), 0 0 40px rgba(0, 123, 255, 0.2); }

.btn-glow { position: relative; overflow: hidden; }
.btn-glow::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.btn-glow:hover::before { left: 100%; }

.grid-lines {
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.3);
    pointer-events: none;
}

@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
}
.whatsapp-pulse { animation: whatsapp-pulse 2s infinite; }

.nav-link { position: relative; color: var(--text-secondary); transition: color 0.3s; }
.nav-link:hover { color: var(--text-primary); }
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, #00e5ff, #007bff);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

.icon-box {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(0, 123, 255, 0.1));
    border: 1px solid rgba(0, 229, 255, 0.2);
}

.section-divider {
    height: 1px;
    background: var(--section-divider);
}

.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}
.mobile-menu.open { transform: translateX(0); }

/* ===== DARK MODE OVERRIDES FOR TAILWIND ===== */
[data-theme="dark"] .text-gray-900 { color: #f1f5f9 !important; }
[data-theme="dark"] .text-gray-800 { color: #e2e8f0 !important; }
[data-theme="dark"] .text-gray-700 { color: #cbd5e1 !important; }
[data-theme="dark"] .text-gray-600 { color: #94a3b8 !important; }
[data-theme="dark"] .text-gray-500 { color: #94a3b8 !important; }
[data-theme="dark"] .text-gray-400 { color: #64748b !important; }
[data-theme="dark"] .text-gray-300 { color: #cbd5e1 !important; }
[data-theme="dark"] .bg-white { background-color: #0b1120 !important; }
[data-theme="dark"] .bg-gray-50\/50 { background-color: #0f172a !important; }
[data-theme="dark"] .bg-gray-100 { background-color: #1e293b !important; }
[data-theme="dark"] .hover\:bg-gray-50:hover { background-color: #1e293b !important; }
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: #334155 !important; }
[data-theme="dark"] .hover\:bg-gray-50\/50:hover { background-color: #1e293b !important; }
[data-theme="dark"] .border-gray-100 { border-color: #1e293b !important; }
[data-theme="dark"] .border-white\/10 { border-color: rgba(255,255,255,0.05) !important; }
[data-theme="dark"] .bg-white\/5 { background-color: rgba(255,255,255,0.03) !important; }
[data-theme="dark"] .shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5) !important; }
[data-theme="dark"] .shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3) !important; }

/* Mobile menu - solid bg, no glass effect */
#mobileMenu {
    background: #ffffff;
}
[data-theme="dark"] #mobileMenu {
    background: #0f172a !important;
}
#mobileMenu .mobile-link { color: #374151; }
#mobileMenu .mobile-link:hover { background: #f3f4f6; }
[data-theme="dark"] #mobileMenu .mobile-link { color: #cbd5e1; }
[data-theme="dark"] #mobileMenu .mobile-link:hover { background: #1e293b; }

/* ===== DARK MODE TOGGLE ===== */
.dark-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #00e5ff;
}
.dark-toggle:hover {
    background: rgba(0, 229, 255, 0.2);
    transform: scale(1.1);
}
.dark-toggle .sun-icon { display: none; }
.dark-toggle .moon-icon { display: block; }
[data-theme="dark"] .dark-toggle .sun-icon { display: block; }
[data-theme="dark"] .dark-toggle .moon-icon { display: none; }

/* ===== PRODUCT FILTERS ===== */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.filter-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: var(--filter-bg);
    color: var(--filter-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.filter-tab:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-1px);
}
.filter-tab.active {
    background: var(--filter-active);
    color: var(--filter-text-active);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* ===== PRODUCTOS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0.5rem 0;
}
@media (min-width: 640px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
@media (min-width: 1024px) {
    .products-grid { grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
}

.product-card {
    border-radius: 1.25rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.product-card.hidden-card {
    display: none;
}
.product-card.fade-out {
    opacity: 0;
    transform: scale(0.9);
}
.product-card.fade-in {
    animation: cardFadeIn 0.4s ease-out forwards;
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (min-width: 640px) {
    .product-card:nth-child(2) { transform: translateY(20px); }
    .product-card:nth-child(4) { transform: translateY(20px); }
}
@media (min-width: 1024px) {
    .product-card:nth-child(2) { transform: translateY(30px); }
    .product-card:nth-child(4) { transform: translateY(30px); }
    .product-card:nth-child(5) { transform: translateY(30px); }
}
/* Reset stagger when filtering */
.product-card.hidden-card ~ .product-card:not(.hidden-card) { transform: none !important; }

.product-card.featured {
    border-color: rgba(0, 229, 255, 0.4);
    grid-column: 1 / -1;
    position: relative;
    background: linear-gradient(135deg, rgba(0,229,255,0.03), rgba(0,123,255,0.03));
}
@media (min-width: 640px) {
    .product-card.featured { grid-column: span 2; }
}
@media (min-width: 1024px) {
    .product-card.featured { grid-column: span 2; }
}

.product-card.featured .product-visual { height: 220px; }
@media (min-width: 640px) {
    .product-card.featured .product-visual { height: 260px; }
}

.product-card.featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 1.4rem;
    background: linear-gradient(135deg, #00e5ff, #007bff, #00e5ff);
    z-index: -1;
    opacity: 0.4;
    animation: featured-border-glow 3s ease-in-out infinite;
}

.featured-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,229,255,0.12) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s;
}
.product-card.featured:hover .featured-glow {
    opacity: 0.6;
}

.featured-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #00e5ff, #007bff);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 9999px;
    box-shadow: 0 0 20px rgba(0,229,255,0.5);
    z-index: 10;
    animation: featured-pulse 2s ease-in-out infinite;
}

@keyframes featured-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0,229,255,0.4); }
    50% { box-shadow: 0 0 35px rgba(0,229,255,0.7), 0 0 60px rgba(0,123,255,0.3); }
}

@keyframes featured-border-glow {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.7; }
}

.product-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
    transform: translateY(-6px) scale(1.02);
}
@media (min-width: 640px) {
    .product-card:nth-child(2):hover,
    .product-card:nth-child(4):hover { transform: translateY(14px) scale(1.02); }
}
@media (min-width: 1024px) {
    .product-card:nth-child(2):hover,
    .product-card:nth-child(4):hover,
    .product-card:nth-child(5):hover { transform: translateY(22px) scale(1.02); }
}

.product-visual {
    height: 170px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
@media (min-width: 640px) {
    .product-visual { height: 200px; }
}
@media (min-width: 1024px) {
    .product-visual { height: 220px; }
}
.product-visual .gradient-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,229,255,0.08), rgba(0,123,255,0.08));
    transition: all 0.5s;
}
.product-card:hover .product-visual .gradient-bg {
    background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(0,123,255,0.15));
}
.product-visual .icon-wrap {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.product-card:hover .product-visual .icon-wrap { transform: scale(1.1); }
.product-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-body { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; }
@media (min-width: 640px) {
    .product-body { padding: 1rem; }
}

.product-body h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
@media (min-width: 640px) {
    .product-body h3 { font-size: 1rem; }
}
@media (min-width: 1024px) {
    .product-body h3 { font-size: 1.1rem; }
}

.product-body .category-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(0, 229, 255, 0.1);
    color: #00b8cc;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.product-body p {
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 640px) {
    .product-body p { font-size: 0.8rem; }
}

.product-body .expand-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #00e5ff;
    font-weight: 500;
    margin-top: auto;
    padding-top: 0.35rem;
}

/* ===== DETAILS BUTTON ===== */
.btn-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(0,229,255,0.1), rgba(0,123,255,0.1));
    color: #00e5ff;
    font-weight: 600;
    font-size: 0.7rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0,229,255,0.15);
    transition: all 0.3s;
    cursor: pointer;
}
.btn-details:hover {
    background: linear-gradient(135deg, #00e5ff, #007bff);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0,229,255,0.2);
}
@media (min-width: 640px) {
    .btn-details { display: none; }
}

/* ===== PRODUCT MODAL ===== */
.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.product-modal {
    background: var(--modal-bg);
    border-radius: 1.5rem 1.5rem 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.product-modal-overlay.open .product-modal {
    transform: translateY(0);
}

.product-modal .modal-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--text-tertiary);
    margin: 0.75rem auto;
    opacity: 0.5;
}

.product-modal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s;
    z-index: 10;
}
[data-theme="dark"] .product-modal .modal-close {
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
}
.product-modal .modal-close:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.1);
}

.product-modal .modal-image {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    background: var(--modal-bg);
    border-radius: 1.5rem 1.5rem 0 0;
}

.product-modal .modal-body {
    padding: 1.5rem;
}

.product-modal .modal-body h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-modal .modal-body .modal-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    background: rgba(0, 229, 255, 0.1);
    color: #00b8cc;
    margin-bottom: 0.75rem;
}

.product-modal .modal-body .modal-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.product-modal .modal-body .modal-features-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.product-modal .modal-body .modal-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.product-modal .modal-body .modal-feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.modal-feature-item svg { width: 1rem; height: 1rem; color: #00e5ff; flex-shrink: 0; }

.product-modal .btn-wa-product-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #00e5ff, #007bff);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 1rem;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0,229,255,0.2);
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.product-modal .btn-wa-product-modal:hover {
    box-shadow: 0 0 30px rgba(0,229,255,0.4);
    transform: translateY(-2px);
}

/* Desktop modal as centered dialog */
@media (min-width: 640px) {
    .product-modal-overlay {
        align-items: center;
    }
    .product-modal {
        border-radius: 1.5rem;
        max-height: 85vh;
        transform: translateY(0) scale(0.9);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .product-modal-overlay.open .product-modal {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    .product-modal .modal-handle { display: none; }
    .product-modal .modal-image { border-radius: 1.5rem 1.5rem 0 0; }
    .btn-details { display: none; }
    .product-card .expand-hint { display: none; }
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    animation: swipe-hint 2s ease-in-out infinite;
}
@media (min-width: 640px) { .scroll-indicator { display: none; } }
@keyframes swipe-hint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* ===== SECTION ADJUSTMENTS ===== */
@media (max-width: 639px) {
    .section-compact { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    .hero-title { font-size: 2rem !important; }
    .hero-subtitle { font-size: 0.9rem !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
