/* ============================================
   PROBACHI - SISTEMA DE TEMAS LIGHT/DARK
   Diseño premium para ambos modos
   ============================================ */

/* ============================================
   TEMA OSCURO (DEFAULT)
   ============================================ */
:root,
[data-theme="dark"] {
    /* Backgrounds */
    --theme-bg-primary: #050505;
    --theme-bg-secondary: #0a0a0a;
    --theme-bg-elevated: #0f0f0f;
    --theme-bg-hover: #151515;
    --theme-bg-card: #0d0d0d;

    /* Text */
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #a0a0a0;
    --theme-text-muted: #666666;
    --theme-text-inverse: #0a0a0a;

    /* Accents - Mantener en ambos */
    --theme-accent-gold: #ffd700;
    --theme-accent-gold-hover: #ffed4e;
    --theme-accent-cyan: #00f3ff;
    --theme-accent-purple: #8b5cf6;

    /* Glassmorphism */
    --theme-glass-bg: rgba(15, 15, 15, 0.8);
    --theme-glass-border: rgba(255, 255, 255, 0.08);
    --theme-glass-blur: blur(20px);

    /* Shadows */
    --theme-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --theme-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --theme-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --theme-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);

    /* Glows */
    --theme-glow-gold: 0 0 25px rgba(255, 215, 0, 0.4);
    --theme-glow-cyan: 0 0 25px rgba(0, 243, 255, 0.4);

    /* Gradients */
    --theme-gradient-hero: linear-gradient(135deg, #000000 0%, #050505 50%, #0a0a0a 100%);
    --theme-gradient-card: linear-gradient(145deg, #0f0f0f 0%, #0a0a0a 100%);
    --theme-gradient-gold: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
    --theme-gradient-primary: linear-gradient(135deg, #00f3ff 0%, #8b5cf6 100%);

    /* Borders */
    --theme-border-subtle: rgba(255, 255, 255, 0.06);
    --theme-border-default: rgba(255, 255, 255, 0.1);
    --theme-border-strong: rgba(255, 255, 255, 0.15);

    /* Input */
    --theme-input-bg: rgba(0, 0, 0, 0.4);
    --theme-input-border: rgba(255, 255, 255, 0.12);
    --theme-input-focus: rgba(255, 215, 0, 0.3);

    /* Scrollbar */
    --theme-scrollbar-track: #0a0a0a;
    --theme-scrollbar-thumb: linear-gradient(180deg, #00f3ff, #8b5cf6);

    /* Navbar */
    --theme-navbar-bg: rgba(10, 10, 10, 0.85);

    /* Footer */
    --theme-footer-bg: #050505;

    /* Toggle icon */
    --theme-toggle-icon: "☀️";
}

/* ============================================
   TEMA CLARO - LUXURY CREAM
   ============================================ */
[data-theme="light"] {
    /* Backgrounds - Tonos crema/beige premium */
    --theme-bg-primary: #faf8f5;
    --theme-bg-secondary: #f5f2ed;
    --theme-bg-elevated: #ffffff;
    --theme-bg-hover: #f0ece5;
    --theme-bg-card: #ffffff;

    /* Text */
    --theme-text-primary: #1a1a1a;
    --theme-text-secondary: #555555;
    --theme-text-muted: #888888;
    --theme-text-inverse: #ffffff;

    /* Accents - Más saturados para light */
    --theme-accent-gold: #d4a500;
    --theme-accent-gold-hover: #b8920a;
    --theme-accent-cyan: #0891b2;
    --theme-accent-purple: #7c3aed;

    /* Glassmorphism - Adaptado */
    --theme-glass-bg: rgba(255, 255, 255, 0.85);
    --theme-glass-border: rgba(0, 0, 0, 0.08);
    --theme-glass-blur: blur(20px);

    /* Shadows - Suaves y elegantes */
    --theme-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --theme-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --theme-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --theme-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);

    /* Glows - Más sutiles */
    --theme-glow-gold: 0 0 20px rgba(212, 165, 0, 0.25);
    --theme-glow-cyan: 0 0 20px rgba(8, 145, 178, 0.2);

    /* Gradients */
    --theme-gradient-hero: linear-gradient(135deg, #faf8f5 0%, #f5f2ed 50%, #f0ece5 100%);
    --theme-gradient-card: linear-gradient(145deg, #ffffff 0%, #faf8f5 100%);
    --theme-gradient-gold: linear-gradient(135deg, #d4a500 0%, #b8920a 100%);
    --theme-gradient-primary: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%);

    /* Borders */
    --theme-border-subtle: rgba(0, 0, 0, 0.04);
    --theme-border-default: rgba(0, 0, 0, 0.08);
    --theme-border-strong: rgba(0, 0, 0, 0.12);

    /* Input */
    --theme-input-bg: #ffffff;
    --theme-input-border: rgba(0, 0, 0, 0.12);
    --theme-input-focus: rgba(212, 165, 0, 0.3);

    /* Scrollbar */
    --theme-scrollbar-track: #f0ece5;
    --theme-scrollbar-thumb: linear-gradient(180deg, #d4a500, #7c3aed);

    /* Navbar */
    --theme-navbar-bg: rgba(255, 255, 255, 0.9);

    /* Footer */
    --theme-footer-bg: #f0ece5;

    /* Toggle icon */
    --theme-toggle-icon: "🌙";
}

/* ============================================
   APLICAR VARIABLES AL SITIO
   ============================================ */

/* Body */
body {
    background-color: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Navbar */
.navbar {
    background: var(--theme-navbar-bg) !important;
    border-bottom-color: var(--theme-border-default) !important;
    transition: background 0.4s ease;
}

.navbar.scrolled {
    background: var(--theme-glass-bg) !important;
    box-shadow: var(--theme-shadow-md) !important;
}

.nav-link {
    color: var(--theme-text-primary) !important;
}

.nav-link:hover {
    color: var(--theme-accent-gold) !important;
}

/* Hero Section */
.hero {
    background: var(--theme-gradient-hero) !important;
}

.hero-bg {
    background: var(--theme-bg-primary) !important;
}

.hero-main-title {
    color: var(--theme-text-primary) !important;
}

.hero-lead {
    color: var(--theme-text-secondary) !important;
}

.gradient-text {
    background: var(--theme-gradient-gold) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

/* Stats */
.stat-number {
    color: var(--theme-accent-gold) !important;
}

.stat-label {
    color: var(--theme-text-secondary) !important;
}

/* Sections */
.products,
.categories,
.features,
.brands,
.flash-sale-section {
    background: var(--theme-bg-primary) !important;
}

.section-title {
    color: var(--theme-text-primary) !important;
}

.section-subtitle {
    color: var(--theme-accent-gold) !important;
}

/* Cards */
.product-card,
.category-card,
.feature-card,
.brand-card,
.review-card {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
    box-shadow: var(--theme-shadow-card) !important;
    transition: all 0.3s ease !important;
}

.product-card:hover,
.category-card:hover,
.feature-card:hover {
    background: var(--theme-bg-elevated) !important;
    border-color: var(--theme-accent-gold) !important;
    box-shadow: var(--theme-shadow-lg), var(--theme-glow-gold) !important;
    transform: translateY(-5px) !important;
}

/* Product Card Content */
.product-name {
    color: var(--theme-text-primary) !important;
}

.product-brand {
    color: var(--theme-text-secondary) !important;
}

.product-price {
    color: var(--theme-accent-gold) !important;
}

.product-old-price {
    color: var(--theme-text-muted) !important;
}

/* Category Cards */
.category-title {
    color: var(--theme-text-primary) !important;
}

.category-description {
    color: var(--theme-text-secondary) !important;
}

/* Feature Cards */
.feature-card h3 {
    color: var(--theme-text-primary) !important;
}

.feature-card p {
    color: var(--theme-text-secondary) !important;
}

.feature-icon {
    color: var(--theme-accent-gold) !important;
}

/* Buttons */
.btn-hero-primary,
.btn-primary {
    background: var(--theme-gradient-gold) !important;
    color: var(--theme-text-inverse) !important;
    box-shadow: var(--theme-glow-gold) !important;
}

.btn-hero-primary:hover,
.btn-primary:hover {
    transform: scale(1.05) !important;
    box-shadow: var(--theme-shadow-lg), var(--theme-glow-gold) !important;
}

.btn-hero-secondary {
    border-color: var(--theme-accent-gold) !important;
    color: var(--theme-accent-gold) !important;
    background: transparent !important;
}

.btn-hero-secondary:hover {
    background: var(--theme-accent-gold) !important;
    color: var(--theme-text-inverse) !important;
}

/* Footer */
.footer {
    background: var(--theme-footer-bg) !important;
    border-top: 1px solid var(--theme-border-default) !important;
}

.footer h3,
.footer h4 {
    color: var(--theme-text-primary) !important;
}

.footer p,
.footer a {
    color: var(--theme-text-secondary) !important;
}

.footer a:hover {
    color: var(--theme-accent-gold) !important;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
    background: var(--theme-input-bg) !important;
    border: 1px solid var(--theme-input-border) !important;
    color: var(--theme-text-primary) !important;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--theme-accent-gold) !important;
    box-shadow: 0 0 0 3px var(--theme-input-focus) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-muted) !important;
}

/* Modals */
.cart-modal,
.search-modal-content {
    background: var(--theme-bg-elevated) !important;
    border: 1px solid var(--theme-border-default) !important;
}

/* Scrollbar */
::-webkit-scrollbar-track {
    background: var(--theme-scrollbar-track) !important;
}

::-webkit-scrollbar-thumb {
    background: var(--theme-scrollbar-thumb) !important;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.05) 0%,
            transparent 100%) !important;
}

[data-theme="light"] .newsletter-section {
    background: linear-gradient(135deg,
            rgba(212, 165, 0, 0.08) 0%,
            transparent 100%) !important;
}

/* Testimonials */
.testimonials-section {
    background: var(--theme-bg-secondary) !important;
}

.testimonials-title {
    color: var(--theme-text-primary) !important;
}

.testimonials-subtitle {
    color: var(--theme-accent-gold) !important;
}

.review-text {
    color: var(--theme-text-secondary) !important;
}

.reviewer-info h4 {
    color: var(--theme-text-primary) !important;
}

/* Flash Sale */
.flash-title {
    color: var(--theme-text-primary) !important;
}

.flash-desc {
    color: var(--theme-text-secondary) !important;
}

/* Loading Screen */
#loading-screen {
    background: var(--theme-gradient-hero) !important;
}

/* Catalog Page */
.catalog-main {
    background: var(--theme-bg-primary) !important;
}

.catalog-sidebar {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
}

.filter-title {
    color: var(--theme-text-primary) !important;
}

.filter-label {
    color: var(--theme-text-secondary) !important;
}

/* Badges */
.product-badge {
    font-weight: 600 !important;
}

[data-theme="light"] .product-badge.badge-bestseller {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
}

[data-theme="light"] .product-badge.badge-new {
    background: linear-gradient(135deg, #0891b2, #06b6d4) !important;
}

[data-theme="light"] .product-badge.badge-sale {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

/* ============================================
   BRAND LOGOS & CARDS - LIGHT MODE FIX
   ============================================ */

/* Brand cards need dark background in light mode to show white logos */
[data-theme="light"] .brand-card {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .brand-card:hover {
    background: rgba(20, 20, 20, 0.98) !important;
    border-color: var(--theme-accent-gold) !important;
}

/* Alternative: Invert white logos to black (if you prefer white cards) */
/* Uncomment the following if you want white cards with inverted logos:
[data-theme="light"] .brand-logo {
    filter: grayscale(100%) invert(1) opacity(0.8) !important;
}
[data-theme="light"] .brand-card:hover .brand-logo {
    filter: grayscale(0%) invert(1) opacity(1) !important;
}
*/

/* Brands section background */
[data-theme="light"] .brands {
    background: var(--theme-bg-secondary) !important;
}

/* Hero section fixes */
[data-theme="light"] .hero-bg,
[data-theme="light"] .gradient-overlay {
    background: var(--theme-gradient-hero) !important;
}

[data-theme="light"] .grid-pattern {
    opacity: 0.03 !important;
}

/* Carousel items */
[data-theme="light"] .carousel-item {
    background: radial-gradient(circle at center, rgba(212, 165, 0, 0.05) 0%, transparent 70%) !important;
}

[data-theme="light"] .carousel-item::before {
    background: radial-gradient(circle, rgba(212, 165, 0, 0.08) 0%, transparent 70%) !important;
}

/* Product info overlay */
[data-theme="light"] .product-info-overlay {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .product-info-overlay p {
    color: var(--theme-text-secondary) !important;
}

/* Flash sale section */
[data-theme="light"] .flash-sale-section {
    background: linear-gradient(135deg, rgba(212, 165, 0, 0.08) 0%, var(--theme-bg-primary) 100%) !important;
}

[data-theme="light"] .flash-bg-effect {
    opacity: 0.05 !important;
}

/* Floating badge */
[data-theme="light"] .floating-badge {
    background: rgba(212, 165, 0, 0.1) !important;
    border: 1px solid rgba(212, 165, 0, 0.3) !important;
}

[data-theme="light"] .badge-text {
    color: var(--theme-text-primary) !important;
}

/* Hero badge (Distribuidor Oficial) */
[data-theme="light"] .hero-badge {
    background: rgba(212, 165, 0, 0.1) !important;
    border: 1px solid rgba(212, 165, 0, 0.3) !important;
    color: var(--theme-accent-gold) !important;
}

/* Timer boxes in flash sale */
[data-theme="light"] .timer-box {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .timer-number {
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .timer-label {
    color: var(--theme-text-secondary) !important;
}

/* Review cards */
[data-theme="light"] .review-card {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .quote-icon {
    color: var(--theme-accent-gold) !important;
}

/* Scroll hint */
[data-theme="light"] .scroll-hint {
    color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .scroll-line {
    background: linear-gradient(to bottom, var(--theme-accent-gold), transparent) !important;
}

/* WhatsApp button */
[data-theme="light"] .whatsapp-button {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3) !important;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--theme-glass-bg);
    border: 1px solid var(--theme-border-default);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: var(--theme-bg-hover);
    border-color: var(--theme-accent-gold);
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: all 0.4s ease;
}

/* Sun icon (visible in dark mode) */
.theme-toggle-btn .sun-icon {
    color: var(--theme-accent-gold);
    position: absolute;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Moon icon (visible in light mode) */
.theme-toggle-btn .moon-icon {
    color: var(--theme-accent-purple);
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

/* Light mode: show moon, hide sun */
[data-theme="light"] .theme-toggle-btn .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .theme-toggle-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes theme-fade {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

body {
    animation: theme-fade 0.4s ease;
}

/* ============================================
   PRODUCT PAGE - LIGHT MODE FIXES
   ============================================ */

/* Main product page background */
[data-theme="light"] .product-main {
    background: var(--theme-bg-primary) !important;
    color: var(--theme-text-primary) !important;
}

/* Override the hardcoded premium-bg variable for light mode */
[data-theme="light"] {
    --premium-bg: var(--theme-bg-primary);
    --premium-card-bg: var(--theme-glass-bg);
    --premium-border: var(--theme-border-default);
}

/* Breadcrumb */
[data-theme="light"] .breadcrumb {
    color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .breadcrumb a {
    color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .breadcrumb a:hover {
    color: var(--theme-accent-gold) !important;
}

/* Product gallery main image */
[data-theme="light"] .main-image {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .main-image img {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15)) !important;
}

/* Thumbnails */
[data-theme="light"] .thumbnail {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .thumbnail:hover,
[data-theme="light"] .thumbnail.active {
    border-color: var(--theme-accent-gold) !important;
    background: rgba(212, 165, 0, 0.05) !important;
}

/* Product details card */
[data-theme="light"] .product-details {
    background: var(--theme-bg-card) !important;
    border: 1px solid var(--theme-border-default) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
}

/* Product title */
[data-theme="light"] .product-title {
    background: linear-gradient(to right, #1a1a2e 20%, #2d2d44 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Rating text */
[data-theme="light"] .rating-text {
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .reviews-count {
    color: var(--theme-text-secondary) !important;
}

/* Price section */
[data-theme="light"] .product-price-section {
    border-bottom: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .old-price {
    color: var(--theme-text-muted) !important;
}

/* Description */
[data-theme="light"] .product-description {
    color: var(--theme-text-secondary) !important;
}

/* Specs grid */
[data-theme="light"] .product-specs {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .spec-label {
    color: var(--theme-text-muted) !important;
}

[data-theme="light"] .spec-value {
    color: var(--theme-text-primary) !important;
}

/* Quantity controls */
[data-theme="light"] .quantity-control {
    background: var(--theme-bg-secondary) !important;
    border: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .qty-btn {
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .qty-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .quantity-control input {
    color: var(--theme-text-primary) !important;
}

/* Buy now button */
[data-theme="light"] .btn-buy-now {
    border: 1px solid var(--theme-border-default) !important;
    color: var(--theme-text-primary) !important;
}

[data-theme="light"] .btn-buy-now:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: var(--theme-text-primary) !important;
}

/* Benefits section */
[data-theme="light"] .product-benefits {
    border-top: 1px solid var(--theme-border-default) !important;
}

[data-theme="light"] .benefit {
    color: var(--theme-text-secondary) !important;
}

/* Ambient lights - hide in light mode */
[data-theme="light"] .ambient-light {
    opacity: 0.05 !important;
}

/* 360 viewer button */
[data-theme="light"] .btn-toggle-360 {
    background: var(--theme-bg-primary) !important;
    border: 1px solid var(--theme-border-default) !important;
    color: var(--theme-text-primary) !important;
}

/* Stock status */
[data-theme="light"] .stock-status {
    color: var(--theme-text-secondary) !important;
}

[data-theme="light"] .stock-status.in-stock {
    color: #16a34a !important;
}

[data-theme="light"] .stock-status.low-stock {
    color: #d97706 !important;
}

[data-theme="light"] .stock-status.out-of-stock {
    color: #dc2626 !important;
}

/* ============================================
   PRINT STYLES - Always light
   ============================================ */
@media print {
    :root {
        --theme-bg-primary: #ffffff !important;
        --theme-text-primary: #000000 !important;
    }
}