:root {
    --main: #a855f7;
    /* purple */
    --bg: #fdf4ff;
    /* light pink background */
    --dark: #4c1d95;
    /* dark purple text */
    --success: #38bdf8;
    /* light blue */

    /* New Theme Colors */
    --bg-color: #fdf4ff;
    --card-bg: #ffffff;
    --text-color: #4c1d95;
    --main-color: #a855f7;
    --border-color: #fbcfe8;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-color: #1e1b4b;
    /* dark purple */
    --card-bg: #312e81;
    /* card */
    --text-color: #f5d0fe;
    /* light pink text */
    --border-color: #4c1d95;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    margin: 0;
    overflow-x: hidden;

}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10%;
    background: linear-gradient(90deg, #a855f7, #38bdf8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bg);
    letter-spacing: -1px;
}

.navbar,
.card,
.cart-sidebar,
.modal-content {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 50%;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Search aur Input Fields for Dark Mode */
input {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
}

.search-section {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.search-box input:focus {
    border-color: var(--main);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
    transition: transform 0.2s;
    color: linear-gradient(45deg, #0ea5e9, #9333ea);
}

.cart-icon:active {
    transform: scale(0.9);
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid white;

}

/* --- Container & Filters --- */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
   
}

.filter-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 30px;
    background: white;
    color: var(--dark);
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-btn.active {
    background: linear-gradient(45deg, #a855f7, #38bdf8);
    color: white;
}


/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
}

.add-btn {
    width: 100%;
    background: linear-gradient(45deg, #a855f7, #ec4899);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.add-btn:hover {
    background: linear-gradient(45deg, #9333ea, #db2777);
}

/* --- Sidebar Cart --- */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100%;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

/* Sidebar Header */
.cart-header {
    padding: 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #94a3b8;
}

.cart-items-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Custom Scrollbar for Cart */
.cart-items-container::-webkit-scrollbar {
    width: 5px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #0ea5e9, #9333ea);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: 0.3s;
}

.checkout-btn:hover {
    background: linear-gradient(45deg, #38bdf8, #a855f7);
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 420px;
    margin: 60px auto;
    padding: 35px;
    border-radius: 25px;
    position: relative;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#checkout-form input {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

#checkout-form input:focus {
    outline: none;
    border-color: var(--main);
}

.confirm-pay-btn {
    width: 100%;
    padding: 16px;
    background: var(--main);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
}

/* ===============================
   RESPONSIVE DESIGN
================================ */

/* Tablets (768px and below) */
@media (max-width: 768px) {

    .navbar {
        padding: 15px 5%;
    }

    .logo {
        font-size: 1.3rem;
    }

    .search-box {
        max-width: 90%;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card img {
        height: 180px;
    }

    .cart-sidebar {
        width: 300px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {

    .navbar {
        flex-direction: row;
        padding: 10px 5%;
    }

    .logo {
        font-size: 1.2rem;
    }

    .cart-icon {
        font-size: 1.2rem;
    }

    .search-section {
        padding: 0 10px;
    }

    .search-box input {
        font-size: 0.9rem;
        padding: 10px 15px 10px 40px;
    }

    .filter-container {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
        /* single column */
    }

    .card {
        padding: 12px;
    }

    .card img {
        height: 160px;
    }

    .add-btn {
        padding: 10px;
        font-size: 0.9rem;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 95%;
        margin: 30px auto;
        padding: 20px;
    }

    #checkout-form input {
        padding: 10px;
        font-size: 0.9rem;
    }

    .confirm-pay-btn {
        padding: 12px;
    }
}

/* Large Screens (1200px and above) */
@media (min-width: 1200px) {

    .container {
        max-width: 1200px;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card img {
        height: 240px;
    }
}