/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Brand Colors - Indigo/Purple Theme */
    --color-primary: #4F46E5;
    /* Indigo 600 */
    --color-primary-dark: #4338CA;
    /* Indigo 700 */
    --color-secondary: #A78BFA;
    /* Purple 400 */
    --color-accent: #10B981;
    /* Emerald 500 */
    --color-accent-light: #6EE7B7;
    /* Emerald 300 */

    /* Neutral Colors - Light Mode */
    --color-bg: #F9FAFB;
    /* Gray 50 */
    --color-surface: #FFFFFF;
    /* White */
    --color-bg-alt: #F3F4F6;
    /* Gray 100 */
    --color-text: #1F2937;
    /* Gray 800 */
    --color-text-muted: #6B7280;
    /* Gray 500 */
    --color-border: #E5E7EB;
    /* Gray 200 */

    /* Typography */
    --font-main: '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);

    /* Layout */
    --container-width: 1200px;
    --header-height: 70px;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --color-bg: #111827;
    /* Gray 900 */
    --color-surface: #1F2937;
    /* Gray 800 */
    --color-bg-alt: #0F172A;
    /* Slate 900 */
    --color-text: #F9FAFB;
    /* Gray 50 */
    --color-text-muted: #9CA3AF;
    /* Gray 400 */
    --color-border: #374151;
    /* Gray 700 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img,
svg {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. UTILITIES & LAYOUT
   ========================================= */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.section-padding {
    padding: 5rem 0;
}

.bg-alt {
    background-color: var(--color-bg-alt);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.center-text {
    text-align: center;
}

.hidden {
    display: none !important;
}

.hidden-mobile {
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary-outline {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.full-width {
    width: 100%;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
}

.icon {
    width: 1.5rem;
    height: 1.5rem;
}

.relative {
    position: relative;
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--color-accent);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* =========================================
   3. HEADER / NAV
   ========================================= */
.navbar {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
    background-color: rgba(17, 24, 39, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-muted);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section {
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background-color: rgba(79, 70, 229, 0.2);
    top: -100px;
    right: -50px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background-color: rgba(16, 185, 129, 0.2);
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.hero-image svg {
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    transition: transform 0.5s ease;
}

.hero-image:hover svg {
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
}

/* =========================================
   5. FEATURES SECTION
   ========================================= */
.section-header {
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--color-text-muted);
}

/* =========================================
   6. PRODUCTS SECTION
   ========================================= */
.product-filters {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.search-bar {
    position: relative;
    max-width: 300px;
    margin-top: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--color-primary);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    color: var(--color-text-muted);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--color-border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
}

.product-image {
    height: 240px;
    background-color: #e0e7ff;
    /* Fallback for no image */
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view-btn {
    background-color: white;
    color: var(--color-text);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.product-card:hover .quick-view-btn {
    transform: translateY(0);
}

.product-details {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-to-cart-icon-btn {
    background-color: var(--color-bg-alt);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    transition: var(--transition);
}

.add-to-cart-icon-btn:hover {
    background-color: var(--color-primary);
    color: white;
}

/* =========================================
   7. ABOUT & CONTACT
   ========================================= */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.stats-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.code-block {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 2rem;
    border-radius: var(--radius-lg);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff5f56;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
}

.contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.error-msg {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error input {
    border-color: #ef4444;
}

.form-group.error .error-msg {
    display: block;
}

/* =========================================
   8. FOOTER
   ========================================= */
.footer {
    background-color: var(--color-bg-alt);
    padding-top: 4rem;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding-bottom: 4rem;
}

.footer-brand h3 {
    margin-bottom: 1rem;
}

.footer-links,
.footer-social {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* =========================================
   9. MODALS & SIDEBARS
   ========================================= */
.modal-overlay,
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Let overlay catch clicks */
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    background-color: var(--color-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    pointer-events: auto;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-modal-content {
    max-width: 700px;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 350px;
    background-color: var(--color-surface);
    z-index: 10002;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.hidden-right {
    transform: translateX(100%);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

/* =========================================
   10. ANIMATIONS & RESPONSIVE
   ========================================= */
@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(0, 20px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-100 {
    animation-delay: 0.1s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal Class (handled by JS) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--color-surface);
        padding: 2rem;
        flex-direction: column;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        transition: transform 0.3s;
        z-index: 999;
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .about-visual {
        order: -1;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .sidebar {
        width: 85%;
    }
}