/* CSS Variables */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #8b5cf6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-light {
    background: var(--white);
    color: var(--primary-color);
}

.btn-light:hover {
    background: var(--bg-gray);
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

/* ==================== NAVBAR ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.cart-btn:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: var(--white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    background: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.mobile-link {
    display: block;
    padding: 0.8rem;
    color: var(--text-dark);
    border-radius: 5px;
    transition: var(--transition);
}

.mobile-link:hover,
.mobile-link.active {
    background: var(--bg-gray);
    color: var(--primary-color);
}

/* ==================== HERO SECTION ==================== */
.hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('./assets/banner-image.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-content p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-content .btn {
    animation: fadeInUp 0.8s ease 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== FEATURES SECTION ==================== */
.features {
    padding: 5rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 15px;
    background: var(--bg-light);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
}

/* ==================== TRENDING SECTION ==================== */
.trending {
    padding: 5rem 0;
    background: var(--bg-gray);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.trending-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.trending-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.trending-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 1.5rem;
    background: var(--white);
}

.trending-card-body {
    padding: 1.5rem;
}

.trending-card-body h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-card-body .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rating {
    display: flex;
    gap: 2px;
    margin: 0.5rem 0;
}

.rating i {
    font-size: 0.9rem;
    color: #fbbf24;
}

.rating i.empty {
    color: #d1d5db;
}

/* ==================== PRODUCTS SECTION ==================== */
.products-section {
    padding: 5rem 0;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 3rem;
}

.category-btn {
    padding: 10px 25px;
    border: none;
    background: var(--bg-gray);
    color: var(--text-dark);
    border-radius: 50px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-transform: capitalize;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Loader */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loader.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader p {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    background: var(--white);
    padding: 1.5rem;
}

.product-image img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.product-body {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.product-body h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-body .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-body .rating {
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-details {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-details:hover {
    background: var(--border-color);
}

.btn-add-cart {
    background: var(--primary-color);
    color: var(--white);
}

.btn-add-cart:hover {
    background: var(--primary-dark);
}

/* ==================== NEWSLETTER SECTION ==================== */
.newsletter {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    text-align: center;
}

.newsletter h2 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.newsletter p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    min-width: 250px;
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
}

/* ==================== FOOTER ==================== */
.footer {
    background: #1f2937;
    color: var(--white);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-col p {
    color: #9ca3af;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #9ca3af;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

/* ==================== PRODUCT MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 2rem;
}

.modal-product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.modal-product-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.modal-product-desc {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.modal-product-category {
    display: inline-block;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-transform: capitalize;
    margin-bottom: 1.5rem;
}

.modal-product-actions {
    display: flex;
    gap: 1rem;
}

.modal-product-actions button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* ==================== CART SIDEBAR ==================== */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--white);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.3rem;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.cart-close:hover {
    color: var(--text-dark);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    color: var(--text-light);
    padding: 3rem 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: var(--bg-gray);
    border-radius: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-info .price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-controls button {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-gray);
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.cart-item-controls button:hover {
    background: var(--border-color);
}

.cart-item-controls span {
    min-width: 25px;
    text-align: center;
}

.cart-item-remove {
    background: none !important;
    color: #ef4444;
    font-size: 0.8rem;
    width: auto !important;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-total span:first-child {
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-total span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-checkout {
    width: 100%;
    padding: 15px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .mobile-menu.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid,
    .trending-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        min-width: 100%;
    }

    .modal-product-actions {
        flex-direction: column;
    }
}