/* 
  Modern Design System 
  Aesthetic: Refined Editorial
  Primary: Deep Indigo
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Base Colors (Shared) */
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --accent: #c026d3;
    --success: #10b981;
    --whatsapp: #25D366;
    
    /* Light Mode Tokens (Default) */
    --bg: #ffffff;
    --hero-bg: #fdfdfd;
    --surface-soft: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --grain-opacity: 0.2;

    /* Spacing & Radii */
    --inner-radius: 12px;
    --outer-radius: 24px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: clamp(24px, 5vw, 48px);
    --spacing-2xl: clamp(40px, 10vw, 80px);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 var(--shadow-color);
    --shadow-md: 0 4px 6px -1px var(--shadow-color);
    --shadow-lg: 0 10px 15px -3px var(--shadow-color);
    --shadow-premium: 0 30px 60px -12px rgba(0,0,0,0.12), 0 18px 36px -18px rgba(0,0,0,0.15);

    /* Transitions */
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 150ms;
    --duration-base: 300ms;
}

[data-theme="dark"] {
    --bg: #030712;
    --hero-bg: #030712;
    --surface-soft: #111827;
    --surface-glass: rgba(3, 7, 18, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --grain-opacity: 0.1;
    
    color-scheme: dark;
}

/* Base Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--duration-fast);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

input, textarea, select {
    background-color: var(--surface-soft);
    color: var(--text-main);
    border: 1px solid var(--border);
    transition: background-color var(--duration-base), color var(--duration-base), border-color var(--duration-base);
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.section-padding {
    padding: clamp(40px, 6vw, 80px) 0;
}

/* Typography Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px; /* Increased padding as requested */
    border-radius: var(--inner-radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform var(--duration-fast) var(--ease-out), 
                box-shadow var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
}

[data-theme="dark"] .btn-primary {
    box-shadow: 0 4px 20px 0 rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.23);
}

.btn-secondary {
    background: var(--surface-soft);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white !important;
}

/* Icon Buttons */
.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.icon-btn:hover {
    background: var(--surface-soft);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

[data-theme="dark"] .icon-btn {
    border-color: var(--primary-light);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.1);
}

.icon-btn svg {
    position: absolute;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

/* Fluid Icon Transitions */
.icon-btn .moon-icon { 
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

.icon-btn .sun-icon {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

[data-theme="dark"] .icon-btn .sun-icon { 
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

[data-theme="dark"] .icon-btn .moon-icon { 
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

/* Glassmorphism Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 400ms var(--ease-out);
    padding: 15px 0;
}

.header.scrolled {
    padding: 10px 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 var(--spacing-md);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid transparent;
    border-radius: 20px;
    transition: all 400ms var(--ease-out);
}

.header.scrolled .nav {
    border-color: transparent;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 2px 0;
}

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

.logo span {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

[data-theme="dark"] .logo span {
    background: linear-gradient(135deg, #fff 30%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


.nav-links {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .nav-links {
    background: rgba(0, 0, 0, 0.2);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 480px) {
    .nav-actions .btn-primary {
        display: none; /* Hide 'Browse All' on tiny screens to save space */
    }
    .logo {
        font-size: 1.25rem;
    }
}

.nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(79, 70, 229, 0.08);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .nav-link.active {
    color: var(--primary-light);
    background: rgba(79, 70, 229, 0.15);
}

/* Hamburger & Mobile Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 2100;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger:hover {
    background: var(--surface-soft);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    transition: all 300ms var(--ease-out);
}

.nav-active .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-active .hamburger span:nth-child(2) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    position: relative;
    padding: clamp(80px, 8vw, 120px) 0 clamp(30px, 4vw, 50px);
    background: var(--hero-bg);
    overflow: hidden;
    min-height: auto; /* Removed fixed min-height to reduce empty space */
    display: flex;
    align-items: center;
}

/* Subtle Film Grain */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: var(--grain-opacity);
    pointer-events: none;
    z-index: 5;
    background-image: url("https://www.transparenttextures.com/patterns/stardust.png");
    filter: brightness(100%);
}

#hero-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#hero-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }

    /* Mobile Menu Overlay */
    .nav-links.active {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        z-index: 2000;
        padding: 0;
        border: none;
        border-radius: 0;
        animation: slideInDown 500ms cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .nav-links.active .nav-link {
        font-size: 2rem;
        font-weight: 700;
        opacity: 0;
        padding: 10px 30px;
        transform: translateY(20px);
        animation: linkReveal 400ms var(--ease-out) forwards;
    }

    .nav-links.active .nav-link:nth-child(1) { animation-delay: 100ms; }
    .nav-links.active .nav-link:nth-child(2) { animation-delay: 200ms; }
    .nav-links.active .nav-link:nth-child(3) { animation-delay: 300ms; }
    .nav-links.active .nav-link:nth-child(4) { animation-delay: 400ms; }
}

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes linkReveal {
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 480px) {
    .product-hero {
        padding-top: 100px;
    }
    .hero-ctas {
        flex-direction: column;
    }
    .modal-content {
        padding: 30px 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 0.95;
    margin-bottom: var(--spacing-lg);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-main);
}

.hero-title span {
    display: block;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-main);
    opacity: 0.85;
    margin-bottom: var(--spacing-xl);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-ctas {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* Product Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.product-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--outer-radius);
    overflow: hidden;
    transition: var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 40px 80px -20px rgba(79, 70, 229, 0.3);
    border-color: var(--primary-light);
}

.product-image-container {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-soft);
    position: relative;
}

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

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

.product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.product-content {
    padding: var(--spacing-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.product-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-weight: 700;
    font-size: 1.25rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 800ms var(--ease-out);
}

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

/* Faster Hero Reveal */
.hero .reveal {
    transition: all 400ms var(--ease-out);
}

/* Responsive */

/* Payment Selection Grid */
.payment-selection-grid {
    display: grid;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px; /* Increased from 16px */
    background: var(--surface-soft);
    border: 2px solid transparent;
    border-radius: var(--inner-radius);
    transition: all var(--duration-fast);
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.payment-option:hover {
    background: var(--border-light);
    border-color: var(--border);
}

.payment-option.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.option-brand {
    width: 60px;
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.option-brand img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.option-icon { font-size: 1.5rem; }
.option-name { font-weight: 600; font-size: 1rem; flex-grow: 1; }
.option-check { color: var(--primary); font-weight: 800; }

.payment-option-divider {
    text-align: center;
    position: relative;
    margin: 10px 0;
}

.payment-option-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-light);
    z-index: 1;
}

.payment-option-divider span {
    position: relative;
    z-index: 2;
    background: var(--bg);
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active { 
    display: flex; 
}

.modal-open {
    overflow: hidden !important;
}

.modal-content {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 480px;
    max-height: 90vh; /* Don't exceed viewport */
    overflow-y: auto; /* Scroll internally */
    border-radius: var(--outer-radius);
    padding: 40px;
    position: relative;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.5);
    animation: modalIn 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile adjustments for a more compact modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
        max-height: 95vh;
    }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.modal-instruction {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.amount-display, .number-display {
    background: var(--surface-soft);
    padding: 20px;
    border-radius: var(--inner-radius);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amount-label, .number-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
}

.amount-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.number-copy-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.number-value {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 700;
}

.copy-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.modal-steps {
    margin: 24px 0;
}

.modal-steps h3 { font-size: 0.9rem; margin-bottom: 12px; }
.modal-steps ol { padding-left: 20px; font-size: 0.9rem; color: var(--text-muted); }
.modal-steps li { margin-bottom: 8px; }

.btn-whatsapp {
    background: #25D366;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* Testimonials & Trust Sections */
.testimonial-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: var(--outer-radius);
    text-align: right;
    position: relative;
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.testimonial-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-direction: row-reverse;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.2rem;
}

.user-info h4 { font-size: 1rem; margin: 0; color: var(--text-main); }
.user-info p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.pd-egp-price {
    font-size: 1.15rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: 6px;
    display: block;
}

.trust-badge-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-soft);
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-light);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 5vw, 60px);
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}
