/* ===== VARIABLES (Trust & Professional Theme) ===== */
:root {
    --bg-color: #f3f4f6; /* Very light gray background */
    --surface-color: #ffffff; /* Pure white cards */
    --text-main: #1f2937; /* Dark charcoal text */
    --text-muted: #6b7280; /* Muted gray */
    
    /* Psychological Trust Colors */
    --accent-blue: #2563eb; /* Trustworthy Stripe/PayPal Blue */
    --accent-blue-hover: #1d4ed8;
    --success-green: #10b981; /* High conversion green */
    
    --font-sans: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
}

/* Flags */
.flag-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    max-width: 300px;
    padding-bottom: 4px;
    animation: pulse-border 2s infinite;
    border-radius: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.5);
}
.flag-selector::-webkit-scrollbar { display: none; }

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.flag-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(80%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.flag-btn img {
    width: 28px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.flag-btn:hover { 
    opacity: 1; 
    filter: grayscale(0%); 
    transform: scale(1.2) translateY(-2px); 
}
.flag-btn.active { 
    opacity: 1; 
    filter: grayscale(0%); 
    transform: scale(1.2); 
}

/* ===== TOP BAR ===== */
.top-bar {
    background-color: #111827;
    color: white;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}
@media (max-width: 768px) {
    .top-bar { display: none; }
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.highlight { color: var(--accent-blue); }

/* Category Filters in Navbar */
.category-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 2px;
}
.category-filters::-webkit-scrollbar { display: none; }

.cat-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.cat-btn:hover { color: var(--text-main); background: var(--bg-color); }
.cat-btn.active {
    background: var(--bg-color);
    color: var(--accent-blue);
    font-weight: 600;
}

/* ===== HERO SECTION (SHINY) ===== */
.hero {
    text-align: center;
    padding: 4rem 5%;
    background: linear-gradient(to bottom, var(--surface-color), var(--bg-color));
    border-bottom: 1px solid #e5e7eb;
}

.hero-title {
    font-size: 4rem;
    font-family: var(--font-display, 'Inter', sans-serif);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

/* ===== ADVANCED STORE CONTROLS ===== */
.store-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.control-filters {
    display: flex;
    gap: 15px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
}
.filter-toggle:hover { color: var(--accent-blue); }

.filter-toggle input {
    display: none;
}

.toggle-label {
    padding: 8px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-toggle input:checked + .toggle-label {
    background: var(--accent-blue);
    color: white;
    border-color: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.glass-select {
    appearance: none;
    background: var(--surface-color) url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") no-repeat right 15px top 50%;
    background-size: 10px auto;
    padding: 10px 40px 10px 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    outline: none;
}
.glass-select:hover, .glass-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
    .store-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    .control-filters {
        justify-content: center;
    }
}

.shiny-text {
    background: linear-gradient(90deg, #2563eb, #10b981, #2563eb);
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-slogan {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.8rem; }
    .hero-slogan { font-size: 1.1rem; }
}

/* ===== STORE SECTION ===== */
.store-section {
    padding: 2rem 5%;
    min-height: 80vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== PRODUCT CARD (CLEAN & TRUSTWORTHY) ===== */
.product-card {
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    position: relative;
}
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success-green);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.product-info-clean {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-title-clean {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.product-price-clean {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.original-price {
    font-size: 0.95rem;
    color: #9ca3af; /* Light gray */
    text-decoration: line-through;
    font-weight: 500;
}

.discount-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-left: auto;
}

.free-price {
    color: #ef4444; /* Rojo brillante para gratis */
}

/* ===== OFFER TIMERS ===== */
.offer-timer {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 2;
    animation: pulse-red 2s infinite;
}

.modal-offer-timer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    z-index: 2;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.offer-timer.expired, .modal-offer-timer.expired {
    background: #6b7280;
    animation: none;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background: var(--surface-color);
    border-radius: 16px;
    width: 95%; max-width: 900px; max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px); transition: transform 0.2s;
    box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
}
.close-modal:hover { background: #e5e7eb; }

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image-col {
    background: #f9fafb;
    display: flex; align-items: center; justify-content: center;
    position: relative; /* CRITICAL BUG FIX: Keeps the offer timer inside the image column */
}
.modal-main-img {
    width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover;
}

.modal-info-col {
    padding: 2.5rem;
    display: flex; flex-direction: column; justify-content: center;
}

.modal-title {
    font-size: 1.8rem; font-weight: 800; color: var(--text-main);
    margin-bottom: 0.5rem; line-height: 1.2;
}
.modal-desc {
    color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem;
    white-space: pre-wrap; /* MANTENER LOS SALTOS DE LÍNEA DEL TEXTO ORIGINAL */
}
.modal-price {
    font-size: 2.2rem; font-weight: 800; color: var(--accent-blue);
    margin-bottom: 1.5rem;
}

.modal-features {
    list-style: none; margin-bottom: 2rem;
    background: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #e2e8f0;
}
.modal-features li {
    margin-bottom: 0.5rem; color: var(--text-main); font-weight: 500; font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.modal-buy-btn {
    width: 100%; text-align: center; font-size: 1.1rem; padding: 1.2rem;
    background: var(--accent-blue); color: white;
    border: none; border-radius: 8px; font-weight: 700; cursor: pointer;
    transition: background 0.2s; box-shadow: var(--shadow-md);
}
.modal-buy-btn:hover { background: var(--accent-blue-hover); }

.free-btn {
    background: #ef4444; /* Red button for free */
}
.free-btn:hover {
    background: #dc2626;
}

.free-text {
    color: #ef4444 !important;
}

/* ===== CHECKOUT MODAL ===== */
.checkout-content {
    max-width: 500px;
    padding: 2rem;
}

.checkout-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.checkout-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.checkout-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--success-green);
    margin-top: 0.5rem;
}

.checkout-form {
    margin-bottom: 2rem;
}

.checkout-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.checkout-form input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    outline: none;
}

.checkout-form input:focus {
    border-color: var(--accent-blue);
}

.checkout-form small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.checkout-methods h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.payment-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.payment-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.stripe-btn { background: #635bff; color: white; }
.mp-btn { background: #009ee3; color: white; }
.paypal-btn { background: #ffc439; color: #003087; }

.checkout-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
footer {
    padding: 2rem 5%; background: var(--surface-color);
    border-top: 1px solid #e5e7eb; text-align: center;
}
.footer-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.trust-badges { display: flex; justify-content: center; gap: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
    .navbar { 
        flex-direction: row; 
        flex-wrap: wrap;
        gap: 0; 
        padding-bottom: 0; 
    }
    .logo {
        flex: 1;
    }
    .nav-right { 
        position: relative; 
        top: auto; 
        right: auto; 
    }
    .flag-selector {
        max-width: 150px;
        padding: 2px;
    }
    .category-filters { 
        width: 100%; 
        justify-content: flex-start; 
        padding-bottom: 10px; 
        border-bottom: 1px solid #e5e7eb; 
        margin-top: 1rem;
        order: 3;
    }
    .modal-grid { grid-template-columns: 1fr; }
    .modal-info-col { padding: 1.5rem; }
}

/* ===== TOAST NOTIFICATIONS (Frutiger Aero Glassmorphism) ===== */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 5px solid #00B0FF;
    border-radius: 8px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #01579B;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}
.toast.success { border-left-color: #10B981; color: #064E3B; }
.toast.error { border-left-color: #EF4444; color: #7F1D1D; }
.toast.warning { border-left-color: #F59E0B; color: #78350F; }
.toast.fade-out { animation: slideOut 0.4s ease forwards; }

@keyframes slideIn {
    to { transform: translateX(0); }
}
@keyframes slideOut {
    to { transform: translateX(120%); opacity: 0; }
}
