/* =========================================
   BASIC STYLING
========================================= */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: #f4f5f7; 
    overflow-x: hidden;
}

/* =========================================
   HEADER & SHRINK ON SCROLL
========================================= */
header { 
    background-color: #ffffff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
    padding: 12px 120px 12px 25px; /* Right side mein Cart ke liye fix jagah */
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    transition: all 0.25s ease;
}

.logo-section { 
    cursor: pointer; 
    margin-right: 15px;
}
.logo-text { 
    font-size: 26px; 
    font-weight: 900; 
    color: #d82b2b; 
    margin: 0; 
    transition: font-size 0.25s ease;
}
.tagline { 
    font-size: 12px; 
    color: #555; 
    font-style: italic; 
    display: block;
    transition: all 0.2s ease;
}

.top-nav { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    justify-content: center;
    flex: 1;
    transition: all 0.25s ease;
}
.top-nav a { 
    text-decoration: none; 
    color: #333; 
    font-weight: bold; 
    padding: 6px 11px; 
    font-size: 14px;
    border-radius: 5px; 
    transition: all 0.25s ease; 
    white-space: nowrap;
}
.top-nav a:hover { background: #d82b2b; color: white; }

/* Cart hamesha Top-Right par fix rahega */
.cart-section { 
    position: absolute; 
    top: 16px; 
    right: 25px; 
    cursor: pointer; 
    font-size: 18px; 
    font-weight: bold; 
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.25s ease;
}
.cart-count-badge { 
    position: absolute; 
    top: -6px; 
    right: -10px; 
    background-color: #d82b2b; 
    color: white; 
    font-size: 12px; 
    border-radius: 50%; 
    padding: 2px 7px; 
}

/* 🌟 SCROLL HONE PAR HEADER AUR CATEGORIES CHOTE HONE KA CODE 🌟 */
header.scrolled {
    padding: 6px 110px 6px 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
header.scrolled .logo-text {
    font-size: 19px;
}
header.scrolled .tagline {
    display: none; /* Scroll karne par tagline chhup jayegi */
}
header.scrolled .top-nav {
    gap: 4px;
}
header.scrolled .top-nav a {
    font-size: 11.5px;
    padding: 3px 7px;
}
header.scrolled .cart-section {
    top: 8px;
    right: 20px;
    transform: scale(0.9);
}

/* =========================================
   PRODUCT GRID
========================================= */
.container { max-width: 1100px; margin: 20px auto; padding: 20px; }

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 25px; 
    margin-top: 20px;
}
.product-card { 
    background: white; 
    padding: 15px; 
    border-radius: 12px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.08); 
    text-align: center; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}
.product-card:hover { transform: translateY(-5px); border: 1px solid #d82b2b; }
.product-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 8px; }
.product-card h3 { margin: 15px 0 5px; font-size: 17px; color: #333; line-height: 1.3;}
.product-card p { color: #28a745; font-size: 20px; font-weight: bold; margin-bottom: 10px; }

.product-options { background: #f9f9f9; padding: 10px; border-radius: 6px; margin-bottom: 10px; text-align: left; font-size: 13px; }
.opt-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.opt-row select, .opt-row input { padding: 4px; border: 1px solid #ccc; border-radius: 4px; width: 60%; font-size: 13px; outline: none; }
.opt-row input { width: 50px; text-align: center; }

.add-to-cart-btn-small { background-color: #333; color: white; border: none; padding: 12px; width: 100%; cursor: pointer; border-radius: 6px; font-weight: bold; font-size: 15px; margin-top: auto; transition: 0.3s; }
.add-to-cart-btn-small:hover { background-color: #d82b2b; }

/* =========================================
   PRODUCT DETAILS PAGE
========================================= */
.details-flex { display: flex; flex-wrap: wrap; gap: 30px; background: white; padding: 30px; border-radius: 10px; }
.main-product-image { width: 100%; max-width: 450px; height: 400px; object-fit: cover; border-radius: 10px; border: 1px solid #ddd; }
.thumbnail-gallery { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; }
.thumbnail-gallery img, .yt-thumb-img { width: 70px !important; height: 70px !important; object-fit: cover; border-radius: 5px; border: 2px solid transparent; cursor: pointer; opacity: 0.6; transition: 0.3s;}
.thumbnail-gallery img:hover, .thumbnail-gallery img.active-thumb, .yt-thumb-img.active-thumb { opacity: 1; border-color: #d82b2b; }
.details-info { flex: 1; min-width: 300px; }

.detail-options { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; background: #f8f9fa; padding: 15px; border-radius: 8px; border: 1px solid #eee; }
.detail-opt-row { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: bold; }
.detail-opt-row select, .detail-opt-row input { padding: 8px; font-size: 15px; border: 1px solid #ccc; border-radius: 5px; width: 60%; }
.detail-opt-row input { width: 80px; text-align: center; }

.add-to-cart-btn { background-color: #d82b2b; color: white; border: none; padding: 15px; width: 100%; font-size: 18px; cursor: pointer; border-radius: 5px; margin-top: 20px;}
.magic-description { color: #555; line-height: 1.6; margin-bottom: 20px; white-space: pre-wrap; font-family: inherit; }

/* =========================================
   📱 MOBILE RESPONSIVE MEDIA QUERIES 📱
========================================= */
@media (max-width: 768px) {
    header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 6px; 
        padding: 8px 12px; 
    }
    .logo-text { font-size: 22px; }
    .tagline { font-size: 11px; }

    .cart-section { 
        position: absolute; 
        top: 10px; 
        right: 18px; 
    } 

    .top-nav { 
        width: 100%; 
        justify-content: center; 
        border-top: 1px solid #eee; 
        padding: 6px 0 2px 0; 
        gap: 5px;
    }
    .top-nav a {
        font-size: 12px;
        padding: 4px 8px;
        background: #f8f9fa;
        border: 1px solid #eee;
    }

    /* Mobile par scroll karne par categories bilkul compact ho jayengi */
    header.scrolled {
        padding: 4px 10px;
        gap: 3px;
    }
    header.scrolled .logo-text {
        font-size: 17px;
    }
    header.scrolled .cart-section {
        top: 4px;
        right: 14px;
        transform: scale(0.85);
    }
    header.scrolled .top-nav {
        padding: 3px 0 0 0;
        gap: 3px;
    }
    header.scrolled .top-nav a {
        font-size: 10.5px;
        padding: 2px 6px;
    }

    /* Mobile Grid: Ek Row mein 2 Products */
    .container { padding: 10px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    .product-card { padding: 8px; border-radius: 8px; }
    .product-card img { height: 140px; }
    .product-card h3 { font-size: 12px; margin: 5px 0; }
    .product-card p { font-size: 14px; margin-bottom: 5px;}
    
    .product-options { padding: 5px; font-size: 11px; }
    .opt-row label { font-size: 10px; }
    .opt-row select, .opt-row input { font-size: 10px; padding: 2px; width: 65%; }
    
    .add-to-cart-btn-small { padding: 6px; font-size: 12px; }
    
    /* Product Details Page on Mobile */
    .details-flex { padding: 15px; gap: 15px; }
    .main-product-image { height: auto; max-width: 100%; aspect-ratio: 1/1; }
    .thumbnail-gallery img, .yt-thumb-img { width: 50px !important; height: 50px !important; }
    
    .details-info { min-width: 100%; }
    .details-info h2 { font-size: 20px; margin-bottom: 5px; }
    #detail-price-display { font-size: 18px; margin-bottom: 10px; }
    .detail-opt-row { font-size: 13px; }
    .detail-opt-row select, .detail-opt-row input { font-size: 13px; padding: 5px; }
    .add-to-cart-btn { padding: 12px; font-size: 16px; margin-top: 10px; }
    .magic-description { font-size: 14px; }
}