/* GENERAL & ROOT VARIABLES */
:root {
    --primary-color: #4F46E5;
    --secondary-color: #F59E0B;
    --green-color: #16a34a;
    --whatsapp-color: #128C7E;
    --text-dark: #111827;
    --text-light: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-color: #613412;
    --slider-interval-duration: 5s;
}

html { 
    scroll-behavior: smooth; 
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-dark); 
}

/* Scroll rokne ke liye jab menu khula ho */
body.menu-open {
    overflow: hidden;
}

/* --- UPDATED HEADER & SEARCH STYLES FOR SCROLL EFFECT --- */
#page-header {
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Default state: Logo visible, search hidden */
#header-logo-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
/* --- HEADER SEARCH BAR STYLING (FINAL FIX) --- */
#header-search-container a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 0.5rem 1rem;
    background-color: var(--bg-white);
    border-radius: 8px; /* BADLA HUA */
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Aur yeh wala badlav bhi karein */
#header-search-container {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease-in, transform 0.3s ease-in;
    pointer-events: none;
    padding: 0 0.5rem; /* YEH LINE ADD HUI HAI */
}



/* Scrolled state: Logo hidden, search visible */
.header-scrolled #header-logo-container {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.header-scrolled #header-search-container {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Ab click ho sakta hai */
}
/* --- END OF HEADER SCROLL STYLES --- */


/* LOADER */
.loader { border-radius: 50%; width: 40px; height: 40px; margin: 0 auto; border-top: 4px solid rgba(79, 70, 229, 0.2); border-right: 4px solid rgba(79, 70, 229, 0.2); border-bottom: 4px solid rgba(79, 70, 229, 0.2); border-left: 4px solid var(--primary-color); transform: translateZ(0); animation: loader 1.1s infinite linear; }
@keyframes loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* UNIVERSAL HORIZONTAL SCROLLER */
.horizontal-scroller, .category-scroll-container, .carousel-container { display: flex; gap: 0.1rem; overflow-x: auto; scroll-behavior: smooth; padding: 0.5rem 1rem; scrollbar-width: none; -ms-overflow-style: none; }
.horizontal-scroller::-webkit-scrollbar, .category-scroll-container::-webkit-scrollbar, .carousel-container::-webkit-scrollbar { display: none; }

/* REVEAL ON SCROLL ANIMATION */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }


/* --- HOMEPAGE SPECIFIC STYLES --- */

/* SEARCH (Below Header) */
#search-container { background-color: var(--bg-white); padding: 0.5rem 1rem; }
#search-link { display: flex; align-items: center; width: 100%; padding: 0.75rem 1rem; background-color: var(--bg-light); border-radius: 8px; border: 1px solid var(--border-color); text-decoration: none; color: var(--text-light); }
#search-link:hover { border-color: var(--primary-color); }
#search-link .search-icon { color: var(--text-dark); margin-right: 0.75rem; }


/* SIDE MENU STYLES */
#menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 199; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
body.menu-open #menu-overlay { opacity: 1; visibility: visible; }
#side-menu { position: fixed; top: 0; left: 0; width: 80%; max-width: 300px; height: 100%; background-color: var(--bg-white); z-index: 200; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; }
body.menu-open #side-menu { transform: translateX(0); box-shadow: 0 0 20px rgba(0,0,0,0.2); }
.menu-items { padding: 0.5rem; overflow-y: auto; flex-grow: 1; }
.menu-item { display: flex; align-items: center; padding: 0.9rem 1rem; border-radius: 8px; text-decoration: none; color: var(--text-dark); font-weight: 500; cursor: pointer; transition: background-color 0.2s; }
.menu-item:hover, .menu-item.active { background-color: #f3f4f6; color: var(--primary-color); }
.menu-item img { width: 24px; height: 24px; margin-right: 1rem; opacity: 0.8; }
.menu-item .fa-chevron-down { transition: transform 0.3s ease; }
.menu-item.open .fa-chevron-down { transform: rotate(180deg); }
.submenu { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; padding-left: 1rem; }
.submenu.open { max-height: 500px; }
.submenu-item { display: flex; align-items: center; padding: 0.75rem 1rem 0.75rem 2.5rem; border-radius: 8px; text-decoration: none; color: var(--text-light); font-size: 0.9rem; }
.submenu-item:hover { background-color: #f9fafb; }
.submenu-item img { width: 20px; height: 20px; margin-right: 1rem; }


/* SECTION CONTAINER & TITLE (Global) */
.section-container { padding: 1.5rem 0; }
.section-title { font-size: 1.4rem; font-weight: 800; text-align: left; margin-bottom: 1rem; letter-spacing: -0.5px; padding: 0 1rem; }
@media (min-width: 768px) { .section-title { font-size: 1.6rem; } }
@media (min-width: 1024px) { .section-container { padding: 2rem 0; } }

/* SLIDER */
.slider-wrapper { padding: 0 1rem; margin-top: 0.5rem; }
.slider-container { position: relative; width: 100%; overflow: hidden; aspect-ratio: 16 / 8.5; max-height: 400px; border-radius: 12px; user-select: none; }
.slider { display: flex; height: 100%; cursor: grab; }
.slider.grabbing { cursor: grabbing; }
.slider.transitioning { transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.slide { width: 100%; height: 100%; flex-shrink: 0; position: relative; }
.slide video, .slide picture, .slide img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; border-radius: 12px; pointer-events: none; }
.slider-dots { display: flex; justify-content: center; gap: 8px; z-index: 10; padding-top: 0.5rem; }
.slider-dots .dot { width: 8px; height: 4px; background: rgba(0, 0, 0, 0.15); border-radius: 50px; cursor: pointer; transition: all 0.4s ease; overflow: hidden; }
.slider-dots .dot.active { background: rgba(0, 0, 0, 0.3); width: 32px; }
.slider-dots .dot .timer { width: 0%; height: 100%; background: var(--text-dark); border-radius: 50px; }
.slider-dots .dot.active .timer { width: 100%; transition: width var(--slider-interval-duration) linear; }


/* VIDEO CARD */
.video-card { flex: 0 0 70%; max-width: 300px; border-radius: 12px; overflow: hidden; position: relative; box-shadow: 0 4px 15px rgba(0,0,0,0.1); display: block; text-decoration: none; }
.video-card img { width: 100%; height: 100%; object-fit: cover; }
.video-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); padding: 1rem; }
.video-card-title { color: white; font-weight: 700; font-size: 1rem; }
.video-card-desc { color: #e5e7eb; font-size: 0.8rem; margin-top: 0.25rem; }
.play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; color: rgba(255,255,255,0.9); }


/* INFO MARQUEE */
#info-marquee-section { margin: 1rem 0; padding: 0.75rem 0; } 
.marquee-viewport { overflow: hidden; } 
.marquee-text { white-space: nowrap; display: inline-block; padding-left: 100%; animation: marquee-scroll 20s linear infinite; will-change: transform; } 
@keyframes marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }


/* DESKTOP FOOTER */
#desktop-footer { display: none; } 
@media (min-width: 768px) { 
    #desktop-footer { display: block; background-color: var(--bg-white); color: var(--text-light); padding: 3rem 2rem; border-top: 1px solid var(--border-color); } 
}
.footer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; } 
.footer-column h3 { font-weight: 600; color: var(--text-dark); margin-bottom: 1rem; } 
.footer-column a { display: block; margin-bottom: 0.5rem; transition: color 0.3s; } 
.footer-column a:hover { color: var(--primary-color); } 
.footer-bottom { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border-color); text-align: center; font-size: 0.9rem; }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }


/* --- PRODUCT CARD STYLES (UNIFIED & GLOBAL) --- */
.product-card { background-color: white; border-radius: 8px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05); border: 1px solid #E5E7EB; transition: transform 0.3s ease, box-shadow 0.3s ease; display: block; overflow: hidden; text-decoration: none; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }
.product-media-container, .product-image-container { position: relative; width: 100%; padding-top: 100%; background-color: #f3f4f6; }
.product-media-container img, .product-image-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.product-details { padding: 0.75rem; text-align: center; }
.product-name { font-weight: 600; color: var(--text-dark); margin-bottom: 0.25rem; font-size: 0.9rem; }
.product-price { display: flex; align-items: baseline; gap: 0.5rem; justify-content: center; }
.display-price { font-weight: 700; color: var(--text-dark); font-size: 1.1rem; }
.original-price { font-size: 0.85rem; text-decoration: line-through; color: var(--text-light); }
.product-discount { color: #16a34a; font-size: 0.875rem; font-weight: 600; margin-top: 0.25rem; }
.carousel-item { flex: 0 0 45%; scroll-snap-align: start; }
@media (min-width: 640px) { .carousel-item { flex: 0 0 30%; } }
@media (min-width: 1024px) { .carousel-item { flex: 0 0 20%; } }

/* General Card Tag Styles (Global) */
.card-rating-tag { position: absolute; top: 6px; right: 6px; background-color: #16a34a; color: white; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 6px; display: flex; align-items: center; gap: 4px; z-index: 5; }
.card-rating-tag .fa-star { font-size: 10px; }
.product-offer-tag { position: absolute; bottom: 0.6rem; left: 0.5rem; padding: 2px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 500; z-index: 5; }
.offer-tag-top-left { top: 8px; left: 8px; bottom: auto; right: auto; }
.rating-tag-bottom-left { bottom: 8px; left: 8px; top: auto; right: auto; background-color: rgba(0,0,0,0.4); backdrop-filter: blur(2px); font-size: 11px; padding: 2px 6px; }

/* Toast Notification (Global) */
#toast-notification { /* Basic toast styles */ }
#toast-notification.success { background-color: var(--green-color); }
#toast-notification.error { background-color: #ef4444; }

/* --- ADD TO CART SYSTEM (Global) --- */
.header-cart-link { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--text-dark); }
#cart-item-count { position: absolute; top: 4px; right: 2px; background-color: #ef4444; color: white; font-size: 11px; font-weight: 600; line-height: 1; min-width: 18px; height: 18px; padding: 3px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--bg-white); transition: transform 0.2s ease-in-out; }
#cart-item-count:empty { display: none; }
#add-to-cart-btn, #go-to-cart-btn { background-color: var(--primary-color); transition: background-color 0.3s, transform 0.3s; }
#add-to-cart-btn:hover, #go-to-cart-btn:hover { transform: scale(1.05); }
.hidden { display: none !important; }

.add-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8%; border: 1.5px solid var(--border-color); color: var(--primary-color); background-color: white; font-size: 1.2rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease-in-out; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.add-btn:hover { background-color: #ffffff; border-color: var(--primary-color); transform: scale(1.1); }
.add-btn.added { background-color: var(--primary-color); color: white; transform: scale(1.1); border-color: var(--primary-color); }
.standard-card-add-btn { position: absolute; bottom: 8px; right: 8px; z-index: 10; }

/* --- HEADER SEARCH BAR STYLING (FINAL FIX) --- */
#header-search-container a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 0.5rem 1rem;
    background-color: var(--bg-white);
    border-radius: 9999px; /* Pill shape */
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.95rem;
}
#header-search-container a:hover {
    border-color: var(--primary-color);
}
#header-search-container .search-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-dark);
    margin-right: 0.5rem;
}


/* --- GLOBAL SEARCH FUNCTIONALITY STYLES --- */
/* Search suggestions dropdown */
#search-suggestions { 
    position: absolute; 
    top: calc(100% + 5px); 
    left: 0; 
    right: 0; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); 
    z-index: 60; 
    max-height: 300px; 
    overflow-y: auto; 
}
.suggestion-item { 
    display: flex; 
    align-items: center; 
    padding: 0.75rem; 
    border-bottom: 1px solid #f3f4f6; 
    cursor: pointer; 
    transition: background-color 0.2s; 
    text-decoration: none; 
}
.suggestion-item:hover { 
    background-color: #f9fafb; 
}
.suggestion-item:last-child { 
    border-bottom: none; 
}
.suggestion-item img { 
    width: 40px; 
    height: 40px; 
    object-fit: cover; 
    border-radius: 8px; 
    margin-right: 0.75rem; 
}
.suggestion-item span { 
    color: var(--text-dark); 
}
#category-suggestions { 
    background-color: #f9fafb; 
    padding: 0.75rem; 
    border-bottom: 1px solid #e5e7eb; 
}
.suggestion-tag { 
    display: inline-block; 
    background-color: #e5e7eb; 
    color: #4b5563; 
    padding: 0.25rem 0.75rem; 
    border-radius: 9999px; 
    font-size: 0.8rem; 
    margin-right: 0.5rem; 
    margin-bottom: 0.5rem; 
    cursor: pointer; 
    transition: all 0.2s; 
}
.suggestion-tag:hover { 
    background-color: #d1d5db; 
    color: #1f2937; 
}

/* Overlay and background blur when search is active */
#search-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: rgba(0, 0, 0, 0.4); 
    z-index: 35; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
    pointer-events: none; 
} 
body.search-active #search-overlay { 
    opacity: 1; 
    pointer-events: auto; 
} 
body.search-active > .category-filter-container, 
body.search-active > main { 
    filter: blur(4px); 
    pointer-events: none; 
    user-select: none; 
} 
body.search-active header { 
    filter: none; 
    pointer-events: auto; 
    user-select: auto; 
}


/* Styles for Infinite Scroll Loader */
.deals-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    width: 100%;
}

.deals-loader-container.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #4F46E5; /* Ramazone Primary Color */
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

