/* ================================================================
   THE HYPE COLLECTION — RESPONSIVE & MOBILE STYLES
   Single authoritative file. No conflicts. No !important wars.
   Breakpoints: 1200 | 1024 | 768 | 480 | 360
================================================================ */

/* ── 1. GLOBAL: cursor, tap, inputs ─────────────────────────────── */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}
*, *::before, *::after { cursor: auto !important; }
body { cursor: auto !important; }
#cursor, #cursor-ring { display: none !important; }

a, button, [onclick], label, select,
.filter-btn, .fk-size-btn, .fk-preset-btn,
.size-dot, .modal-size, .quick-btn, .quick-wish,
.modal-add-btn, .modal-wish-btn, .modal-qty-btn,
.cart-close, .cart-checkout-btn, .cart-continue-btn,
.qty-btn, .cart-item-remove, .wish-add-cart, .wish-remove,
.nav-icon, .nav-cta, .newsletter-submit,
.social-link, .view-all, .footer-links a,
.search-close, .search-result-item, .search-tag,
.cat-card, .product-card, .insta-item,
.btn-primary, .btn-secondary { cursor: pointer !important; }
input, textarea { cursor: text !important; }

/* Prevent iOS input zoom */
input, select, textarea { font-size: 16px !important; }
#reg_otp, #forgot_otp { font-size: 22px !important; }

/* Scroll lock — handled entirely by JS (iOS-safe position:fixed approach) */
body.modal-open {
    /* JS sets position:fixed + top offset — do not add overflow:hidden here */
}

/* ── 2. FLIPKART FEATURES (desktop base) ────────────────────────── */
.nav-search-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    padding: 0 14px; height: 40px; flex: 1; max-width: 480px;
    transition: border-color .2s;
}
.nav-search-bar:focus-within { border-color: var(--accent); }
.nav-search-bar input {
    background: none; border: none; color: var(--white);
    font-family: var(--font-mono); font-size: 12px;
    letter-spacing: .05em; outline: none; flex: 1; width: 100%;
}
.nav-search-bar input::placeholder { color: var(--text-dim); }

#navSearchResults .nsr-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer;
    border-bottom: 1px solid var(--border); transition: background .15s;
}
#navSearchResults .nsr-item:hover { background: var(--surface); }
#navSearchResults .nsr-item img { width: 44px; height: 54px; object-fit: cover; flex-shrink: 0; }
#navSearchResults .nsr-name { font-family: var(--font-body); font-size: 14px; color: var(--white); }
#navSearchResults .nsr-price { font-family: var(--font-display); font-size: 16px; color: var(--accent); }
#navSearchResults .nsr-brand { font-family: var(--font-mono); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px; }

.fk-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
    padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.fk-filter-tags {
    display: flex; gap: 6px; flex-wrap: wrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex: 1;
}
.fk-filter-tags::-webkit-scrollbar { display: none; }
.fk-sort-bar { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.fk-count { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--text-dim); white-space: nowrap; }
.fk-sort-wrap { display: flex; align-items: center; gap: 8px; }
.fk-sort-wrap select {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--white); padding: 8px 12px;
    font-family: var(--font-mono); font-size: 10px; outline: none; cursor: pointer;
}
.fk-sort-wrap select:focus { border-color: var(--accent); }

.fk-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.fk-sidebar { background: var(--surface); border: 1px solid var(--border); position: sticky; top: 80px; }
.fk-sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
    text-transform: uppercase; color: var(--white);
}
.fk-filter-group { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fk-filter-title { font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.fk-price-inputs { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fk-price-inputs input { background: var(--deep); border: 1px solid var(--border); color: var(--white); padding: 6px 8px; font-size: 12px !important; outline: none; width: 80px; font-family: var(--font-mono); }
.fk-price-inputs input:focus { border-color: var(--accent); }
.fk-price-presets { display: flex; flex-direction: column; gap: 4px; }
.fk-preset-btn { background: none; border: 1px solid var(--border); color: var(--text-mid); padding: 6px 10px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; cursor: pointer; text-align: left; transition: all .15s; }
.fk-preset-btn:hover, .fk-preset-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,255,0,.05); }
.fk-checkbox-label { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--text-mid); cursor: pointer; margin-bottom: 8px; }
.fk-checkbox-label input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.fk-size-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.fk-size-btn { background: none; border: 1px solid var(--border); color: var(--text-mid); padding: 5px 10px; font-family: var(--font-mono); font-size: 9px; cursor: pointer; transition: all .15s; }
.fk-size-btn:hover, .fk-size-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,255,0,.05); }
.fk-brand-item { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--text-mid); cursor: pointer; margin-bottom: 8px; }
.fk-brand-item input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.fk-grid-wrap { min-width: 0; }
.fk-mobile-filter-btn { display: none; width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--white); padding: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; cursor: pointer; margin-bottom: 16px; }

/* Star ratings */
.product-rating { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.rating-badge { background: #388e3c; color: #fff; font-family: var(--font-mono); font-size: 9px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 3px; }
.rating-badge.low { background: #f57c00; }
.rating-count { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); }

/* Pincode & offers in modal */
.modal-pincode-check { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-offers { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-offer-item { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--text-mid); margin-bottom: 8px; line-height: 1.5; }

/* Related products */
#relatedItems::-webkit-scrollbar { display: none; }
.related-item { flex-shrink: 0; width: 100px; cursor: pointer; transition: transform .2s; }
.related-item:hover { transform: translateY(-2px); }
.related-item img { width: 100px; height: 120px; object-fit: cover; background: var(--surface); display: block; margin-bottom: 6px; }
.related-item-name { font-family: var(--font-body); font-size: 12px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-item-price { font-family: var(--font-display); font-size: 14px; color: var(--accent); }

/* Product modal base */
.modal-img-side { position: relative; overflow: hidden; min-height: 500px; background: var(--surface); }
.modal-main-img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: var(--surface); }
.modal-info-side { padding: 40px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }

/* ── 3. TABLET 1024px ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    nav { padding: 0 20px; }
    .nav-links { display: none; }
    .nav-search-bar { max-width: 300px; }
    .hero { grid-template-columns: 1fr; }
    .hero-right { min-height: 340px; max-height: 400px; }
    .hero-left { padding: 48px 28px; }
    .categories-section, .products-section, .testimonials-section, .newsletter-section { padding: 60px 20px; }
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
    .cat-card:first-child { grid-row: span 1; min-height: 280px; grid-column: span 2; }
    .cat-card:not(:first-child) { min-height: 200px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .testimonials-grid { grid-template-columns: 1fr 1fr; }
    .features-strip { grid-template-columns: 1fr 1fr; }
    .insta-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
    footer, .insta-header { padding-left: 20px; padding-right: 20px; }
    .cart-sidebar, .wish-sidebar { width: 100%; }
    .fk-layout { grid-template-columns: 200px 1fr; }
    .product-modal { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
    .modal-img-side { min-height: 300px; max-height: 380px; }
    .modal-info-side { padding: 24px 20px 32px; }
}

/* ── 4. MOBILE 768px ─────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* NAV */
    nav { padding: 0 14px; height: 56px; gap: 8px; }
    .nav-logo { font-size: 20px; letter-spacing: .06em; }
    .nav-links { display: none !important; }
    .nav-search-bar { display: none !important; }
    .nav-actions { gap: 6px; }
    .nav-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; padding: 0; }
    .nav-cta { padding: 8px 12px; font-size: 9px; letter-spacing: .1em; }
    .announcement { font-size: 9px; padding: 7px 10px; letter-spacing: .06em; }

    /* HERO */
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero-right { order: 1; min-height: 220px; max-height: 280px; }
    .hero-left { order: 2; padding: 24px 14px 20px; }
    .hero-title { font-size: clamp(38px, 11vw, 60px); }
    .hero-subtitle { font-size: 14px; margin: 10px 0 18px; }
    .hero-actions { flex-direction: column; gap: 8px; }
    .btn-primary, .btn-secondary { width: 100%; text-align: center; justify-content: center; padding: 13px 16px; clip-path: none; }
    .hero-stats { gap: 14px; margin-top: 18px; padding-top: 16px; flex-wrap: wrap; }
    .stat-num { font-size: 26px; }
    .stat-label { font-size: 8px; }
    .hero-floating-card { display: none; }
    .hero-season-badge { font-size: 8px; padding: 4px 7px; top: 8px; right: 8px; }
    .hero-tag { font-size: 8px; margin-bottom: 12px; }

    /* SECTION HEADERS */
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
    .section-title { font-size: clamp(26px, 8vw, 40px); }

    /* CATEGORIES */
    .categories-section { padding: 28px 14px; }
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 3px; }
    .cat-card:first-child { grid-row: span 1; min-height: 160px; grid-column: span 2; }
    .cat-card:not(:first-child) { min-height: 130px; }
    .cat-name { font-size: 16px; }
    .cat-link { opacity: 1; transform: none; }

    /* PRODUCTS */
    .products-section { padding: 24px 14px; }
    .fk-toolbar { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 14px; }
    .fk-filter-tags { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
    .filter-btn { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; font-size: 9px; min-height: 36px; }
    .fk-sort-bar { width: 100%; justify-content: space-between; }
    .fk-sort-wrap select { font-size: 11px; padding: 7px 10px; }
    .fk-layout { grid-template-columns: 1fr; gap: 0; }
    .fk-sidebar {
        display: none; position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(290px, 85vw); z-index: 9000;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        background: var(--deep); border-right: 1px solid var(--border);
    }
    .fk-sidebar.open { display: block; }
    .fk-mobile-filter-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
    .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    .product-img-wrap { margin-bottom: 8px; }
    .product-name { font-size: 13px; margin-bottom: 6px; }
    .price-current { font-size: 17px; }
    .product-brand { font-size: 8px; }
    .product-sizes { gap: 3px; margin-top: 6px; }
    .size-dot { width: 24px; height: 24px; font-size: 8px; }
    /* Always show quick actions on touch */
    .product-quick { transform: translateY(0) !important; position: relative !important; background: var(--surface) !important; border-top: 1px solid var(--border); padding: 8px; }
    .quick-btn { font-size: 8px; padding: 9px 4px; }
    .quick-wish { width: 34px; }

    /* PRODUCT MODAL — full screen */
    .product-modal {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100% !important; max-width: 100% !important;
        max-height: 100dvh !important; max-height: 100vh !important;
        transform: none !important;
        grid-template-columns: 1fr !important;
        overflow-y: auto !important; -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border: none !important; border-radius: 0 !important;
        opacity: 0; pointer-events: none;
        transition: opacity .2s !important;
    }
    .product-modal.open { opacity: 1 !important; pointer-events: all !important; }
    .modal-img-side { min-height: 68vw !important; max-height: 75vw !important; }
    .modal-main-img { object-fit: contain !important; }
    .modal-info-side { padding: 14px 14px 60px !important; overflow-y: visible !important; }
    .modal-name { font-size: 19px !important; }
    .modal-price { font-size: 24px !important; }
    .modal-size { width: 38px !important; height: 38px !important; font-size: 10px !important; }
    .modal-qty-btn { width: 42px !important; height: 42px !important; }
    .modal-add-btn { padding: 13px !important; font-size: 11px !important; clip-path: none !important; }
    .modal-wish-btn { width: 46px !important; height: 46px !important; }
    .modal-close { width: 38px; height: 38px; top: 8px; right: 8px; }

    /* CART & WISHLIST */
    .cart-sidebar, .wish-sidebar { width: 100% !important; }
    .cart-header { padding: 14px 14px; }
    .cart-title { font-size: 20px; }
    .cart-items { padding: 10px 14px; }
    .cart-footer { padding: 14px 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
    .cart-item-img { width: 60px; height: 76px; }
    .cart-checkout-btn { padding: 14px; font-size: 14px; clip-path: none; }
    .qty-btn { width: 32px; height: 32px; }

    /* AUTH MODAL — only style the inner div, never force display */
    #authModal > div {
        width: 100% !important; max-width: 100% !important;
        min-height: 100dvh !important; min-height: 100vh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        border: none !important; border-radius: 0 !important;
        overflow-y: auto; box-sizing: border-box !important;
    }
    #authTabLogin, #authTabRegister { min-height: 44px; font-size: 10px; }

    /* CHECKOUT MODAL */
    #checkoutModal > div {
        width: 100% !important; max-width: 100% !important;
        min-height: 100dvh !important; min-height: 100vh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 18px 14px calc(36px + env(safe-area-inset-bottom, 0px)) !important;
        border: none !important; border-radius: 0 !important;
        overflow-y: auto; box-sizing: border-box !important;
    }

    /* PROFILE MODAL */
    #profileModal > div {
        width: 100% !important; max-width: 100% !important;
        min-height: 100dvh !important; min-height: 100vh !important;
        margin: 0 !important;
        padding: 20px 14px calc(36px + env(safe-area-inset-bottom, 0px)) !important;
        border: none !important; border-radius: 0 !important;
        box-sizing: border-box !important;
    }

    /* SEARCH OVERLAY */
    .search-overlay { padding-top: 64px; }
    .search-close { top: 14px; right: 14px; font-size: 22px; }
    .search-input { font-size: clamp(20px, 7vw, 34px); }
    .search-results { grid-template-columns: 1fr; }
    .search-wrapper { padding: 0 14px; }

    /* FEATURE BANNER */
    .feature-content { padding: 32px 14px; }
    .feature-title { font-size: clamp(32px, 10vw, 52px); }
    .feature-timer { gap: 8px; }
    .timer-block { min-width: 50px; padding: 8px 10px; }
    .timer-num { font-size: 22px; }
    .timer-unit { font-size: 8px; }

    /* TESTIMONIALS */
    .testimonials-section { padding: 28px 14px; }
    .testimonials-grid { grid-template-columns: 1fr; gap: 3px; }
    .testimonial-card { padding: 20px 14px; }
    .t-text { font-size: 14px; }

    /* INSTAGRAM */
    .insta-header { padding: 28px 14px 18px; }
    .insta-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; }

    /* NEWSLETTER */
    .newsletter-section { padding: 40px 14px; }
    .newsletter-form { flex-direction: column; }
    .newsletter-input { border-right: 1px solid var(--border); border-bottom: none; }
    .newsletter-submit { width: 100%; padding: 13px; }
    .newsletter-title { font-size: clamp(30px, 9vw, 48px); }

    /* FEATURES STRIP */
    .features-strip { grid-template-columns: 1fr 1fr; }
    .feat-item { padding: 14px 10px; gap: 8px; border-right: none; border-bottom: 1px solid var(--border); }
    .feat-icon { font-size: 18px; }
    .feat-title { font-size: 9px; }
    .feat-desc { font-size: 11px; }

    /* FOOTER */
    footer { padding: 28px 14px 20px; }
    .footer-top { grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
    .footer-brand-logo { font-size: 26px; }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }

    /* TOAST */
    .toast-container { right: 10px; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
    .toast { min-width: auto; width: 100%; font-size: 9px; padding: 11px 12px; }
}

/* ── 5. SMALL PHONE 480px ────────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-right { min-height: 190px; max-height: 240px; }
    .hero-title { font-size: clamp(34px, 10vw, 52px); }
    .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
    .product-name { font-size: 12px; }
    .price-current { font-size: 15px; }
    .categories-grid { grid-template-columns: 1fr 1fr; }
    .cat-card:first-child { min-height: 140px; }
    .cat-card:not(:first-child) { min-height: 110px; }
}

/* ── 6. TINY PHONE 360px ─────────────────────────────────────────── */
@media (max-width: 360px) {
    .products-grid { grid-template-columns: 1fr !important; }
    .hero-title { font-size: 32px; }
    .features-strip { grid-template-columns: 1fr; }
    .feat-item { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── 7. SAFE AREA (iPhone notch / home bar) ─────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .cart-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    .toast-container { bottom: calc(12px + env(safe-area-inset-bottom)); }
}
