* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2ecc71;
    --primary-dark: #27ae60;
    --secondary: #3498db;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --white: #ffffff;
    --danger: #e74c3c;
    --warning: #f39c12;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.8rem;
    transition: transform 0.3s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 120px 0 60px;
    text-align: center;
    margin-top: 70px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.btn-primary {
    display: inline-block;
    background: var(--white);
    color: var(--primary);
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Categories */
.categories {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--dark);
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--light);
    background: var(--white);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Search Bar */
.search-bar {
    max-width: 500px;
    margin: 0 auto 30px;
}

.search-bar input {
    width: 100%;
    padding: 15px 25px;
    border: 2px solid var(--light);
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary);
}

/* Products Grid */
.products {
    padding: 40px 0 80px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--warning);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    font-size: 5rem;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: var(--secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.product-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

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

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price-old {
    font-size: 0.9rem;
    color: #95a5a6;
    text-decoration: line-through;
    margin-left: 8px;
}

.btn-add-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light);
}

.cart-header h3 {
    font-size: 1.3rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--danger);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.cart-item-image {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 700;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: var(--primary-dark);
}

.qty-value {
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

.btn-remove {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: auto;
    transition: background 0.3s;
}

.btn-remove:hover {
    background: #c0392b;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--light);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-checkout:hover {
    background: var(--primary-dark);
}

.btn-clear {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: var(--danger);
    color: var(--white);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: var(--white);
    padding: 15px 30px;
    border-radius: 10px;
    z-index: 300;
    transition: transform 0.3s;
    font-weight: 500;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 25px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .category-grid {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}
