:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --dark: #111827;
    --light: #f3f4f6;
    --white: #ffffff;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;
    --text-main: #374151;
    --text-muted: #6b7280;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header & Navbar */
.frontend-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand-mobile {
    display: flex;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark);
    padding: 5px;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.search-bar {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 500px;
    margin: 0 2rem;
}

.search-bar input {
    flex: 1;
    width: 100%;
    min-width: 150px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px 0 0 8px;
    outline: none;
    font-family: inherit;
}

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

.search-bar button {
    padding: 0.6rem 1.2rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: var(--primary-hover);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Home Slider */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 1.5rem auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.slider-btn:hover {
    background: rgba(255,255,255,1);
}

.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }

/* Sections */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--light);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
}

.category-card p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-details {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-row {
    margin-top: auto;
    margin-bottom: 1rem;
}

.price-selling {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
}

.price-mrp {
    font-size: 0.85rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.discount-badge {
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.btn-add-cart {
    width: 100%;
    padding: 0.6rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-cart:hover {
    background: var(--primary-hover);
}

/* Product Detail Page */
.product-detail-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    display: flex;
    gap: 3rem;
    margin: 2rem auto;
}

.pd-images {
    flex: 1;
}

.pd-main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.pd-thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
}

.pd-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
}

.pd-thumbnails img:hover {
    border-color: var(--primary);
}

.pd-info {
    flex: 1.5;
}

.pd-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.pd-seller {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.pd-price-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
}

.pd-price-selling {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
}

.pd-price-mrp {
    font-size: 1.1rem;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 1rem;
}

.pd-actions {
    display: flex;
    gap: 1rem;
}

.btn-lg {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

.btn-buy-now {
    background: #fbbf24;
    color: var(--dark);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-buy-now:hover {
    filter: brightness(0.95);
}

.pd-description {
    margin-top: 2rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1.5rem;
}

.pd-description h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.pd-description p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer */
.frontend-footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

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

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

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

.footer-col ul li a {
    color: var(--gray-400);
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 0;
    }

    .nav-brand-mobile {
        width: 100%;
        justify-content: space-between;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    .mobile-menu-content {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
        padding-top: 1.5rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--gray-200);
    }
    
    .mobile-menu-content.active {
        display: flex;
    }

    .search-bar {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: column;
        gap: 1.2rem;
        align-items: flex-start;
    }
    
    .cart-icon {
        width: 100%;
    }
    
    .slide img {
        height: 200px;
    }
    
    .product-detail-container {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .pd-main-image {
        height: 250px;
    }
    
    .pd-actions {
        flex-direction: column;
    }
}
