/* Premium HD Base Settings & Exact Flipkart Fonts */
:root {
    --primary-blue: #2874f0;
    --white: #ffffff;
    --gray-bg: #f1f2f4;
    --text-main: #212121;
    --text-gray: #878787;
    --brand-blue: #2a55e5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--gray-bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 25px rgba(0,0,0,0.15);
    overflow-x: hidden;
}

/* HEADER WITH HD SCREENSHOT & INVISIBLE SEARCH BAR */
.header {
    background: #fff;
    position: relative;
    z-index: 1000;
}
.top-header-screenshot {
    width: 100%;
    position: relative;
    background: #fff;
}
.top-header-screenshot img {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast; /* Forces HD rendering */
    image-rendering: crisp-edges;
}

/* Invisible input overlaying the screenshot's search bar area */
.invisible-search {
    position: absolute;
    top: 55%; 
    left: 12%; 
    width: 75%;
    height: 35%;
    background: transparent;
    border: none;
    outline: none;
    color: #333;
    font-size: 15px;
    padding-left: 10px;
}
.invisible-search::placeholder {
    color: transparent; /* Text is in the image, keep placeholder invisible */
}

/* CUSTOM SCROLL IMAGES (Top, Mid, Bottom Buttons) */
.custom-scroll-images {
    display: flex;
    overflow-x: auto;
    width: 100%;
    background: #fff;
    padding: 8px 0;
    scroll-behavior: smooth;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
.custom-scroll-images::-webkit-scrollbar { display: none; }
.custom-scroll-images img {
    height: 58px;
    object-fit: contain;
    flex-shrink: 0;
    pointer-events: none; /* Let container handle the click */
    image-rendering: -webkit-optimize-contrast;
}

/* Blue Line Animation */
.click-blue-line {
    position: absolute;
    bottom: 0;
    height: 3px;
    width: 40px;
    background: var(--primary-blue);
    border-radius: 4px 4px 0 0;
    display: none;
    transition: transform 0.3s ease-out;
    z-index: 10;
}
.click-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(40, 116, 240, 0.25);
    transform: scale(0);
    animation: ripple-anim 0.4s linear;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(3.5); opacity: 0; }
}

/* AUTO-SLIDER BANNER WITH 3S PROGRESS LINE */
.banner-slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    padding: 8px;
    background: #fff;
}
.banner-slides {
    display: flex;
    width: 100%;
    transition: transform 0.4s ease-in-out;
}
.banner-slides img {
    width: 100%;
    flex-shrink: 0;
    border-radius: 8px;
    image-rendering: -webkit-optimize-contrast;
}
.progress-track {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 2px;
}
@keyframes fillBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* STICKY BOTTOM TABS */
.sticky-tabs-bar {
    position: sticky;
    top: 0; /* Makes it stick to top when scrolled past */
    z-index: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    background: white;
}

/* MIDDLE CATEGORY BUTTONS: Fixed to not stick anymore as requested */
#midCategories {
    /* Sticky properties removed so they stay in place */
}

/* SECTION & GRID LAYOUTS */
.main-content { display: flex; flex-direction: column; gap: 8px; background: var(--gray-bg); padding-bottom: 20px;}
.mt-12 { margin-top: 12px; }
.mb-24 { margin-bottom: 24px; }
.section { padding: 16px 12px; background: var(--white); margin: 0 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);}
.bg-white { background: var(--white); }
.radius-lg { border-radius: 12px; }

/* 5 Box Colors */
.light-purple-bg { background: #f4f0ff; }
.light-green-bg { background: #e6f6ee; }
.light-orange-bg { background: #fff4ea; }
.light-blue-bg { background: #eef6ff; }
.light-yellow-bg { background: #fffbe6; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: #000; letter-spacing: -0.2px;}
.arrow-btn { background: #2874f0; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);}

/* Horizontal Scroll Row */
.scroll-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch;}
.scroll-row::-webkit-scrollbar { display: none; }
.card-small { background: white; border-radius: 8px; min-width: 110px; padding: 8px; position: relative; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card-small img { width: 100%; height: 80px; object-fit: contain; margin-bottom: 8px; }
.discount-badge { position: absolute; top: 0; left: 0; background: #2874f0; color: white; font-size: 10px; padding: 3px 6px; border-bottom-right-radius: 8px; border-top-left-radius: 8px; font-weight: bold;}
.card-small-text { font-size: 12px; }
.card-title { color: var(--text-gray); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500;}
.card-subtitle { color: var(--text-main); font-size: 13px;}
.font-bold { font-weight: 700; }

/* Widest Collection 2x2 Grid */
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-item { background: white; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; border: 1px solid #eaeaea; box-shadow: 0 1px 3px rgba(0,0,0,0.03);}
.grid-item img { width: 100%; height: 110px; object-fit: contain; margin-bottom: 8px; }
.grid-text-container { margin-top: auto; }
.text-lg { font-size: 15px; }

/* DYNAMIC PRODUCT GRID - Will auto-scale if you add 200 items */
.dynamic-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}
.product-card { 
    border: 1px solid #f0f0f0; 
    border-radius: 8px; 
    padding: 6px; 
    display: flex; 
    flex-direction: column; 
    background: white; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.product-img-box {
    position: relative;
    background: #fff;
    border-radius: 6px;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.rating-badge { position: absolute; bottom: 4px; left: 4px; background: white; padding: 2px 4px; border-radius: 4px; font-size: 9px; font-weight: bold; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 2px; }
.rating-badge i { color: #388e3c; font-size: 8px;}
.product-details { margin-top: 8px; font-size: 11px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: #212121;}
.price-row { margin-top: 4px; display: flex; align-items: center;}
.old-price { color: var(--text-gray); text-decoration: line-through; margin-right: 4px; font-size: 10px;}
.new-price { font-weight: 700; font-size: 14px; color: #000;}
.offer-row { font-size: 10px; margin-top: 4px; color: var(--brand-blue); font-weight: 500; line-height: 1.2;}
.supercoin-price { font-weight: bold; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; width: 100%; max-width: 480px; background: var(--white); display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid #e0e0e0; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05);}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-gray); font-size: 11px; cursor: pointer; }
.nav-item.active { color: var(--primary-blue); font-weight: bold;}
.nav-item i { font-size: 20px; }
