/**
 * ═══════════════════════════════════════════════════════════════
 * Exercise 7: E-COMMERCE EVENT HANDLING STYLING
 * ═══════════════════════════════════════════════════════════════
 */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
}

/* ───── HEADER & NAVIGATION ───── */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h2 {
    color: #667eea;
    cursor: pointer;
    transition: color 0.3s ease;
}

.logo h2:hover {
    color: #764ba2;
}

.nav-links {
    display: flex;
    gap: 30px;
    flex: 1;
    margin-left: 40px;
}

.nav-item {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-item:hover {
    color: #667eea;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-input {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.cart-icon, .user-icon {
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.3s ease;
}

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

.cart-count {
    background: #dc2626;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ───── BANNER ───── */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 40px;
    text-align: center;
}

.banner-content h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.banner-btn {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* ───── PRODUCTS SECTION ───── */
.products-section {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 40px;
}

.products-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
    color: #333;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ───── PRODUCTS GRID ───── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-emoji {
    font-size: 48px;
    margin-bottom: 15px;
}

.product-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.product-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.view-btn, .quick-add-btn {
    width: 48%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-btn {
    background: #667eea;
    color: white;
    margin-right: 4%;
}

.view-btn:hover {
    background: #764ba2;
}

.quick-add-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #e0e0e0;
}

.quick-add-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ───── MODAL ───── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-image {
    font-size: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-info h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.modal-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin: 15px 0!important;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-selector button {
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quantity-selector button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quantity-selector input {
    width: 50px;
    text-align: center;
    border: 1px solid #e0e0e0;
    padding: 5px;
    border-radius: 5px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #764ba2;
}

/* ───── CART POPUP ───── */
.cart-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.cart-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.cart-items {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.item-emoji {
    font-size: 32px;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.item-price {
    color: #666;
    font-size: 13px;
}

.item-total {
    font-weight: 600;
    color: #667eea;
}

.remove-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.cart-total {
    padding: 15px;
    border-top: 2px solid #e0e0e0;
    font-size: 18px;
    text-align: right;
}

.checkout-btn {
    width: 100%;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: #059669;
}

/* ───── TOAST NOTIFICATION ───── */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideInUp 0.3s ease;
    z-index: 2000;
}

/* ───── ANIMATIONS ───── */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ───── FOOTER ───── */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
}

/* ───── HAMBURGER MENU ───── */
.hamburger {
    display: none;
    cursor: pointer;
    gap: 6px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        flex-direction: column;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        gap: 0;
        margin-left: 0;
        display: none;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

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

    .nav-links .nav-item {
        padding: 15px 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .header-right {
        gap: 10px;
    }

    .search-input {
        width: 120px;
    }

    .banner-content h1 {
        font-size: 32px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

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

    .navbar {
        padding: 10px 15px;
    }

    .logo h2 {
        font-size: 20px;
    }

    .cart-icon, .user-icon {
        font-size: 18px;
    }
}
