/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --black: #000000;

    /* Typography */
    --font-family-base: 'system-ui', -apple-system, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --font-family-headings: var(--font-family-base);

    /* Font Sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    --font-size-6xl: 4rem;      /* 64px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Spacing */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-base: 1rem;     /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    --space-4xl: 6rem;      /* 96px */
    --space-5xl: 8rem;      /* 128px */

    /* Border Radius */
    --border-radius-sm: 0.25rem;   /* 4px */
    --border-radius-base: 0.5rem;  /* 8px */
    --border-radius-lg: 0.75rem;   /* 12px */
    --border-radius-xl: 1rem;      /* 16px */
    --border-radius-2xl: 1.5rem;   /* 24px */
    --border-radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Breakpoints */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;

    /* Layout */
    --container-max-width: 1280px;
    --header-height: 4rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--gray-900);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-base);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-base);
    line-height: var(--line-height-relaxed);
}

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

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-base);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
    color: var(--gray-900);
    text-decoration: none;
}

.nav__logo-icon {
    font-size: var(--font-size-2xl);
}

.nav__links {
    display: none;
    list-style: none;
    gap: var(--space-xl);
}

.nav__link {
    color: var(--gray-600);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    position: relative;
}

.nav__link:hover,
.nav__link--active {
    color: var(--primary-color);
}

.nav__link--active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-base);
}

.cart-link {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: var(--white);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    width: 20px;
    height: 20px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.nav__toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav__toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--gray-700);
    transition: all var(--transition-fast);
}

@media (min-width: 768px) {
    .nav__links {
        display: flex;
    }

    .nav__toggle {
        display: none;
    }
}

/* Hero Section */
.hero {
    padding: var(--space-4xl) 0;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
}

.hero__content {
    display: grid;
    gap: var(--space-3xl);
    align-items: center;
}

.hero__title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
}

.hero__title-highlight {
    color: var(--primary-color);
}

.hero__description {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    margin-bottom: var(--space-2xl);
}

.hero__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-base);
}

.hero__image {
    text-align: center;
}

.hero__img {
    width: 100%;
    height: auto;
    max-width: 500px;
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
    .hero__content {
        grid-template-columns: 1fr 1fr;
    }

    .hero__title {
        font-size: var(--font-size-5xl);
    }

    .hero__actions {
        flex-direction: row;
    }
}

/* Features Section */
.features {
    padding: var(--space-4xl) 0;
    background-color: var(--gray-50);
}

.features__grid {
    display: grid;
    gap: var(--space-2xl);
    grid-template-columns: 1fr;
}

.feature {
    text-align: center;
    padding: var(--space-xl);
    background-color: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-base);
    transition: transform var(--transition-base);
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature__icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-base);
}

.feature__title {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

.feature__description {
    color: var(--gray-600);
    margin-bottom: 0;
}

@media (min-width: 640px) {
    .features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Sections */
.featured-products,
.all-products {
    padding: var(--space-4xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-base);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    margin-bottom: 0;
}

/* Products Grid */
.products-grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-3xl);
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-base);
    margin-bottom: var(--space-3xl);
    padding: var(--space-lg);
    background-color: var(--gray-50);
    border-radius: var(--border-radius-lg);
}

.filters__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filters__label {
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
}

.filters__select {
    padding: var(--space-sm) var(--space-base);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-base);
    background-color: var(--white);
    font-size: var(--font-size-base);
}

@media (min-width: 640px) {
    .filters {
        flex-direction: row;
        justify-content: space-between;
        align-items: end;
    }

    .filters__group {
        min-width: 200px;
    }
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: var(--space-3xl);
}

/* Newsletter */
.newsletter {
    padding: var(--space-4xl) 0;
    background-color: var(--primary-color);
    color: var(--white);
}

.newsletter__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter__title {
    color: var(--white);
    margin-bottom: var(--space-base);
}

.newsletter__description {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
}

.newsletter__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-base);
    max-width: 400px;
    margin: 0 auto;
}

.newsletter__input {
    padding: var(--space-base);
    border: none;
    border-radius: var(--border-radius-base);
    font-size: var(--font-size-base);
}

@media (min-width: 640px) {
    .newsletter__form {
        flex-direction: row;
    }

    .newsletter__input {
        flex: 1;
    }
}

/* Footer */
.footer {
    padding: var(--space-4xl) 0 var(--space-xl);
    background-color: var(--gray-900);
    color: var(--gray-300);
}

.footer__content {
    display: grid;
    gap: var(--space-2xl);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-3xl);
}

.footer__title {
    color: var(--white);
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-base);
}

.footer__subtitle {
    color: var(--white);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-base);
}

.footer__description {
    margin-bottom: var(--space-lg);
}

.footer__social {
    display: flex;
    gap: var(--space-base);
}

.footer__social-link {
    display: inline-block;
    font-size: var(--font-size-xl);
    transition: transform var(--transition-fast);
}

.footer__social-link:hover {
    transform: scale(1.1);
}

.footer__links {
    list-style: none;
}

.footer__links li {
    margin-bottom: var(--space-sm);
}

.footer__links a {
    color: var(--gray-300);
    transition: color var(--transition-fast);
}

.footer__links a:hover {
    color: var(--white);
}

.footer__bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--gray-800);
    text-align: center;
}

.footer__copyright {
    margin: 0;
    color: var(--gray-400);
}

@media (min-width: 640px) {
    .footer__content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer__content {
        grid-template-columns: 2fr repeat(3, 1fr);
    }
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.block { display: block; }
.flex { display: flex; }
.grid { display: grid; }

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl) 0;
}

.loading__spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-base);
}

.loading__text {
    color: var(--gray-600);
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Typography */
@media (min-width: 640px) {
    h1 { font-size: var(--font-size-5xl); }
    h2 { font-size: var(--font-size-4xl); }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--font-size-6xl); }
}