@import url('variables.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 100px;
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    gap: 0.75rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

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

/* Navigation Redesign */
#main-header {
    position: fixed;
    top: 1rem;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

nav {
    height: 70px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-lg);
    margin: 0 auto;
    width: 95%;
    max-width: var(--container-width);
    padding: 0 1.5rem;
}

#main-header.scrolled nav {
    background: var(--surface-light);
    box-shadow: var(--shadow-lg);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: auto;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mega Menu */
.dropdown-menu.mega-menu {
    min-width: 650px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.dropdown:hover .dropdown-menu.mega-menu {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
    .dropdown-menu.mega-menu {
        min-width: 500px;
        grid-template-columns: repeat(2, 1fr);
    }
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--surface-light);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
}

.mobile-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(24, 33, 58, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(59, 130, 246, 0.20);
        border-radius: var(--radius-md);
        padding: 1rem;
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
        animation: slideDown 0.25s ease;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid rgba(59, 130, 246, 0.10);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.6rem;
        color: var(--text-main);
        transition: var(--transition);
    }

    .mobile-toggle.active {
        color: var(--primary-color);
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* Footer */
footer {
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--surface-light);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
}

/* Trending 6-Column Grid */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Top Rated 5-Column Grid */
.top-rated-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 1200px) {
    .top-rated-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .top-rated-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.trending-grid .product-card {
    padding: 0.75rem;
}

.trending-grid h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.trending-grid p {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-grid .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Utility */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: 2.25rem;
}

section {
    padding: var(--spacing-md) 0;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.05em;
}

/* Feature List */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.feature-item {
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

/* Progress Bars / Attribute Ratings */
.attribute-rating {
    margin-bottom: 1rem;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-bar-bg {
    height: 8px;
    background: var(--surface-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
