/* ============================================================
   Registani Achar — Mobile-First Premium Responsive UI
   v2.0 — Complete rewrite for mobile-first excellence
   ============================================================ */

/* ── CSS RESET ENHANCEMENTS ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
body { overflow-x: hidden; -webkit-overflow-scrolling: touch; }

/* ── PAGE CONTENT TOP MARGIN ─────────────────────────────────── */
#pageContentWrapper { margin-top: 117px; }

/* ── STICKY ORDER SUMMARY ────────────────────────────────────── */
.sticky-order-summary { position: sticky; top: 120px; }

/* ─── HERO SLIDER ZOOM & OVERLAY FIX ────────────────────────── */
.hero-slider-item {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transform: none !important;
}
.carousel-item.active .hero-slider-item {
    transform: none !important;
}
.hero-slider-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    z-index: 0;
    transition: transform 8s ease-out !important;
    will-change: transform;
}
.carousel-item.active .hero-slider-bg {
    transform: scale(1.08) !important;
}
.carousel-item:not(.active) .hero-slider-content {
    opacity: 0 !important;
    pointer-events: none !important;
}
.carousel-item .hero-slider-content {
    transition: opacity 0.6s ease-in-out !important;
}
.carousel-item.active .hero-slider-content {
    opacity: 1 !important;
}
.hero-slider-content .badge {
    align-self: flex-start !important;
    width: fit-content !important;
    display: inline-flex !important;
    align-items: center;
}

/* ─── HERO SLIDER STAGGERED TEXT ANIMATIONS ─────────────────── */
.carousel-item:not(.active) .hero-slider-content .badge,
.carousel-item:not(.active) .hero-title,
.carousel-item:not(.active) .hero-subtitle,
.carousel-item:not(.active) .btn-hero {
    opacity: 0 !important;
    transform: translateY(25px) !important;
    transition: none !important;
}
.carousel-item .hero-slider-content .badge,
.carousel-item .hero-title,
.carousel-item .hero-subtitle,
.carousel-item .btn-hero {
    will-change: transform, opacity;
}
.carousel-item.active .hero-slider-content .badge {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, opacity 0.8s ease 0.1s !important;
}
.carousel-item.active .hero-title {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.22s, opacity 0.8s ease 0.22s !important;
}
.carousel-item.active .hero-subtitle {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.34s, opacity 0.8s ease 0.34s !important;
}
.carousel-item.active .btn-hero {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.46s, opacity 0.8s ease 0.46s !important;
}

.hero-title {
    text-shadow: 0 4px 15px rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.6) !important;
}
.hero-subtitle {
    text-shadow: 0 3px 10px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.6) !important;
}

/* =================================================================
   MOBILE SMALL (≤ 575px) — Primary focus
   ================================================================= */
@media (max-width: 575.98px) {

    /* ─── Page Content Margin ─────────────────────────────────── */
    #pageContentWrapper { margin-top: 85px; }

    /* ─── Top Promo Banner ────────────────────────────────────── */
    .top-promo-banner {
        height: 26px !important;
        font-size: 0.62rem !important;
        letter-spacing: 0.01em !important;
        padding: 0 0.25rem !important;
        overflow: hidden !important;
    }
    .top-promo-banner .container { overflow: hidden; }
    .promo-text {
        display: inline-block;
        white-space: nowrap;
        animation: marqueeScroll 20s linear infinite;
    }

    /* ─── Navbar ──────────────────────────────────────────────── */
    .navbar-custom {
        top: 26px !important;
        padding: 0.35rem 0 !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    }
    .navbar-brand-logo { max-height: 36px !important; }
    .navbar-toggler { padding: 0.25rem 0.5rem !important; }
    #mobileNavHeaderActions { display: flex !important; }

    /* ─── Body Bottom Padding (for bottom nav) ────────────────── */
    body { padding-bottom: 62px !important; }

    /* ─── Hero Slider ─────────────────────────────────────────── */
    .hero-slider-item {
        height: 65vh !important;
        min-height: 320px !important;
        max-height: 400px !important;
    }
    .hero-slider-content {
        padding: 0 1.25rem !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    .hero-slider-overlay {
        background: rgba(30, 27, 24, 0.65) !important;
    }
    .hero-slider-content .badge {
        font-size: 0.55rem !important;
        padding: 0.2rem 0.5rem !important;
        margin-bottom: 0.35rem !important;
    }
    .hero-title {
        font-size: 1.25rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.35rem !important;
        text-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
    }
    .hero-subtitle {
        font-size: 0.72rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.65rem !important;
    }
    .btn-hero {
        font-size: 0.72rem !important;
        padding: 0.45rem 1.25rem !important;
        border-radius: 30px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    .carousel-control-prev,
    .carousel-control-next { width: 28px !important; }
    .carousel-control-prev-icon,
    .carousel-control-next-icon { width: 1rem !important; height: 1rem !important; }

    /* ─── Section Titles ──────────────────────────────────────── */
    section.py-5 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
    section.py-5 > .container.py-4 {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    .section-title-wrap { margin-bottom: 1.5rem !important; }
    .section-title { font-size: 1.55rem !important; margin-bottom: 0.25rem !important; }
    .section-subtitle { font-size: 0.65rem !important; letter-spacing: 0.1em !important; }
    .section-title-divider { width: 50px !important; height: 3px !important; margin-top: 0.75rem !important; }

    /* ─── Categories (Horizontal Scroll) ──────────────────────── */
    #categories .container { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
    .premium-category-row {
        gap: 10px !important;
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .premium-category-row > div {
        width: 82px !important;
    }
    .premium-category-row .category-img-wrap {
        width: 62px !important;
        height: 62px !important;
        margin-bottom: 0.35rem !important;
        border-width: 2.5px !important;
    }
    .premium-category-row .category-title {
        font-size: 0.62rem !important;
        font-weight: 700 !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        text-overflow: unset !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    /* ─── Product Cards (2-Column Tight Grid) ─────────────────── */
    .row.g-2,
    .row.g-4 {
        --bs-gutter-x: 0.4rem !important;
        --bs-gutter-y: 0.5rem !important;
    }
    .product-card-item {
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
    }
    .product-card {
        border-radius: 10px !important;
        box-shadow: 0 2px 8px rgba(180,83,9,0.05) !important;
    }
    .product-img-wrap { height: 135px !important; }
    .product-details-wrap { padding: 0.5rem 0.55rem !important; }

    /* Badge + stars row */
    .product-details-wrap > .d-flex.align-items-center.justify-content-between.mb-2 {
        margin-bottom: 0.15rem !important;
    }
    .product-details-wrap .badge[style] {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.3rem !important;
    }
    .product-details-wrap .text-warning.small {
        font-size: 0.58rem !important;
    }

    .product-name {
        font-size: 0.78rem !important;
        height: auto !important;
        max-height: 2.4em !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.2 !important;
    }
    .product-name a { color: inherit !important; }
    .product-desc { display: none !important; }
    .price-wrap {
        margin-bottom: 0.4rem !important;
        gap: 0.25rem !important;
        margin-top: 0.25rem !important;
    }
    .current-price { font-size: 0.92rem !important; font-weight: 800 !important; }
    .compare-price { font-size: 0.68rem !important; }
    .discount-badge {
        top: 0.35rem !important;
        left: 0.35rem !important;
        font-size: 0.58rem !important;
        padding: 0.12rem 0.35rem !important;
    }
    .weight-tag {
        bottom: 0.35rem !important;
        right: 0.35rem !important;
        font-size: 0.58rem !important;
        padding: 0.1rem 0.3rem !important;
    }
    .btn-add-cart {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.35rem !important;
        border-radius: 8px !important;
        border-width: 1.5px !important;
    }
    /* Promo text under product */
    .product-details-wrap .text-danger.small {
        font-size: 0.62rem !important;
        margin-bottom: 0.1rem !important;
    }

    /* ─── Feature Cards (Why Choose Us) ───────────────────────── */
    .feature-item-card {
        padding: 1.15rem !important;
        border-radius: 14px !important;
    }
    .feature-item-card .feature-icon-wrap {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 0.75rem !important;
    }
    .feature-item-card h4 {
        font-size: 0.95rem !important;
        margin-bottom: 0.4rem !important;
    }
    .feature-item-card p {
        font-size: 0.78rem !important;
        line-height: 1.5 !important;
    }

    /* ─── Testimonials ────────────────────────────────────────── */
    .testimonial-card {
        padding: 1.15rem !important;
        border-radius: 14px !important;
    }
    .testimonial-text {
        font-size: 0.85rem !important;
        margin-bottom: 0.85rem !important;
        line-height: 1.55 !important;
    }
    .testimonial-avatar { width: 42px !important; height: 42px !important; }
    .testimonial-name { font-size: 0.88rem !important; }
    .testimonial-designation { font-size: 0.72rem !important; }
    .testimonial-user { gap: 0.75rem !important; }

    /* ─── Customer Portal Mobile ─────────────────────────────── */
    .customer-page-bg {
        padding-top: 1rem !important;
        padding-bottom: 4rem !important;
    }
    .customer-page-bg > .container {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    .welcome-banner {
        padding: 1.15rem !important;
        border-radius: 1rem !important;
    }
    .welcome-banner h3 {
        font-size: 1.2rem !important;
        margin-bottom: 0.25rem !important;
    }
    .welcome-banner p {
        font-size: 0.78rem !important;
    }
    .welcome-banner .btn {
        padding: 0.4rem 1.1rem !important;
        font-size: 0.8rem !important;
    }
    .cust-stat-card {
        padding: 0.75rem 0.85rem !important;
        border-radius: 0.85rem !important;
        gap: 0.65rem !important;
    }
    .cust-stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 0.95rem !important;
        border-radius: 0.6rem !important;
    }
    .cust-stat-label {
        font-size: 0.62rem !important;
    }
    .cust-stat-val {
        font-size: 1.2rem !important;
    }
    .orders-table thead th {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.65rem !important;
    }
    .orders-table tbody td {
        padding: 0.65rem 0.75rem !important;
        font-size: 0.78rem !important;
    }

    /* ─── Cart Drawer ─────────────────────────────────────────── */
    .cart-drawer {
        width: 100vw !important;
        right: -100vw !important;
    }
    .cart-drawer.active { right: 0 !important; }
    .cart-header { padding: 0.85rem 1rem !important; }
    .cart-items-body { padding: 0.85rem 1rem !important; }
    .cart-footer { padding: 0.85rem 1rem !important; }
    .cart-item-img { width: 55px !important; height: 55px !important; border-radius: 8px !important; }
    .cart-item-name { font-size: 0.85rem !important; }
    .cart-item { gap: 0.85rem !important; }

    /* ─── Checkout Page ───────────────────────────────────────── */
    .sticky-order-summary { position: static !important; }
    .py-5.bg-light.min-vh-100 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .py-5.bg-light .container.py-4 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    #checkoutPageContent .col-lg-7 .card,
    #checkoutPageContent .col-lg-5 .card {
        padding: 1rem !important;
        border-radius: 14px !important;
    }
    .payment-method-card { padding: 0.65rem !important; }
    /* Make city/state/pin full width */
    #checkoutPageContent .col-md-5,
    #checkoutPageContent .col-md-4,
    #checkoutPageContent .col-md-3 {
        width: 100% !important;
    }

    /* ─── Product Details Page ─────────────────────────────────── */
    .card.border-0.shadow-sm.rounded-xl.overflow-hidden.bg-white.p-4.p-md-5 {
        padding: 0.85rem !important;
    }
    #mainProductImage { height: 250px !important; object-fit: cover !important; }
    .display-5 { font-size: 1.5rem !important; }
    .fs-2 { font-size: 1.5rem !important; }
    .row.g-5 { --bs-gutter-y: 1.25rem !important; --bs-gutter-x: 0 !important; }
    .col-md-5, .col-md-7 { width: 100% !important; }
    .row.g-3 .col-sm-6 { width: 100% !important; }
    .thumbnail-gallery { border-radius: 6px !important; }
    /* Price box */
    .bg-light.p-3.rounded-4 { padding: 0.75rem !important; border-radius: 12px !important; }

    /* ─── Contact Page ────────────────────────────────────────── */
    .col-md-5.bg-dark {
        padding: 1.25rem !important;
        border-radius: 0 !important;
    }
    .col-md-7.p-4 { padding: 1.15rem !important; }
    /* Full-width columns */
    .col-md-5, .col-md-7 { width: 100% !important; }

    /* ─── Complaint Page ──────────────────────────────────────── */
    .card.border-0.shadow-sm.rounded-xl.overflow-hidden.bg-white.p-4.p-md-5 {
        padding: 1rem !important;
    }

    /* ─── Footer ──────────────────────────────────────────────── */
    .footer-main { padding: 2rem 0 1.25rem !important; }
    .footer-brand-title { font-size: 1.35rem !important; margin-bottom: 0.75rem !important; }
    .footer-text { font-size: 0.82rem !important; }
    .footer-section-title {
        font-size: 0.95rem !important;
        margin-bottom: 0.85rem !important;
        padding-bottom: 0.35rem !important;
    }
    .footer-links a { 
        font-size: 0.85rem !important; 
        display: inline-block !important;
        padding: 4px 0 !important;
        min-height: 32px !important;
    }
    .footer-links li { margin-bottom: 0.4rem !important; }

    /* ─── Mobile Form Controls Font-Size (iOS Auto-Zoom Fix) ───── */
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .form-control,
    .form-select,
    .dl-input {
        font-size: 16px !important;
    }
    .social-icons-wrap { gap: 0.5rem !important; margin-top: 0.85rem !important; }
    .social-icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.82rem !important;
    }
    .footer-bottom-divider { margin: 1.5rem 0 0.85rem !important; }
    .footer-copy { font-size: 0.72rem !important; }
    .footer-tagline { font-size: 0.68rem !important; }
    /* Footer columns — full width */
    .footer-main .col-lg-4,
    .footer-main .col-lg-2,
    .footer-main .col-lg-3 {
        width: 50% !important;
    }
    .footer-main .col-lg-4.col-md-6 {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    /* ─── WhatsApp Float ──────────────────────────────────────── */
    .whatsapp-float-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.3rem !important;
        bottom: 72px !important;
        right: 0.65rem !important;
    }

    /* ─── Mobile Bottom Nav ───────────────────────────────────── */
    .mobile-app-bottom-nav {
        height: 56px !important;
        box-shadow: 0 -2px 16px rgba(0,0,0,0.08) !important;
    }
    .mobile-nav-item {
        font-size: 0.58rem !important;
        min-width: 48px !important;
        padding: 0.25rem 0.35rem !important;
        gap: 2px !important;
    }
    .mobile-nav-item i { font-size: 1.05rem !important; }

    /* ─── Toast on Mobile ─────────────────────────────────────── */
    #custom-toast-container {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 68px !important;
    }
    .custom-toast {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 10px !important;
    }

    /* ─── Forms — Touch Friendly ──────────────────────────────── */
    .form-control, .form-select, .input-group-text {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px !important;
    }
    textarea.form-control { min-height: 90px !important; }
    .form-label { font-size: 0.82rem !important; margin-bottom: 0.25rem !important; }

    /* ─── Breadcrumb ──────────────────────────────────────────── */
    .breadcrumb { font-size: 0.78rem; margin-bottom: 0.5rem !important; }
    nav[aria-label="breadcrumb"] { margin-bottom: 0.5rem !important; }

    /* ─── Category Filter Bar (Products page) ─────────────────── */
    #categoryFilterBar {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0.35rem !important;
        gap: 5px !important;
        scrollbar-width: none !important;
        margin-bottom: 1.25rem !important;
    }
    #categoryFilterBar::-webkit-scrollbar { display: none !important; }
    #categoryFilterBar .btn-filter {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        font-size: 0.75rem !important;
        padding: 0.35rem 0.75rem !important;
    }

    /* ─── Products Page Header ────────────────────────────────── */
    .container.py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    .section-title-wrap.mb-5 { margin-bottom: 1rem !important; }

    /* ─── Offcanvas Menu ──────────────────────────────────────── */
    #mobileMenuOffcanvas .nav-link {
        font-size: 0.95rem !important;
        padding: 0.6rem 0.75rem !important;
    }

    /* ─── Order Success Page ──────────────────────────────────── */
    .table-responsive { font-size: 0.78rem !important; }
    .table th, .table td { padding: 0.45rem 0.25rem !important; }

    /* ─── Magic Box (Lightbox) ────────────────────────────────── */
    .magic-box-content { max-width: 95% !important; border-width: 2px !important; }
    .magic-box-prev { left: 8px !important; padding: 8px 12px !important; font-size: 14px !important; }
    .magic-box-next { right: 8px !important; padding: 8px 12px !important; font-size: 14px !important; }
    .magic-box-close { top: 10px !important; right: 14px !important; font-size: 30px !important; }
}

/* =================================================================
   MOBILE MEDIUM (576px – 767px) — Tablet-portrait
   ================================================================= */
@media (min-width: 576px) and (max-width: 767.98px) {
    #pageContentWrapper { margin-top: 100px; }

    .top-promo-banner { height: 28px !important; font-size: 0.68rem !important; }
    .navbar-custom { top: 28px !important; padding: 0.5rem 0 !important; }
    .navbar-brand-logo { max-height: 42px !important; }

    body { padding-bottom: 66px !important; }

    .hero-slider-item { height: 380px !important; }
    .hero-title { font-size: 1.85rem !important; }
    .hero-subtitle { font-size: 0.92rem !important; }
    .btn-hero { font-size: 0.85rem !important; }

    .section-title { font-size: 1.85rem !important; }

    .product-img-wrap { height: 170px !important; }
    .product-name { font-size: 0.88rem !important; }

    .sticky-order-summary { position: static !important; }
    .col-md-5, .col-md-7 { width: 100% !important; }

    .footer-main { padding: 2.5rem 0 1.5rem !important; }

    .whatsapp-float-btn { bottom: 76px !important; }
}

/* =================================================================
   TABLET (768px – 991px)
   ================================================================= */
@media (min-width: 768px) and (max-width: 991.98px) {
    #pageContentWrapper { margin-top: 110px; }

    .hero-slider-item { height: 450px !important; }
    .hero-title { font-size: 2.5rem !important; }
    .hero-subtitle { font-size: 1.05rem !important; }

    .section-title { font-size: 2.2rem !important; }

    .product-img-wrap { height: 200px !important; }

    .sticky-order-summary { position: static !important; }
}

/* =================================================================
   ANIMATIONS
   ================================================================= */
@keyframes marqueeScroll {
    0%   { transform: translateX(60%); }
    100% { transform: translateX(-100%); }
}

/* =================================================================
   PERFORMANCE — GPU Acceleration
   ================================================================= */
.product-card, .feature-item-card, .testimonial-card,
.category-card, .cart-drawer, .mobile-app-bottom-nav,
.whatsapp-float-btn {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* =================================================================
   MOBILE HEADER ACTION BUTTONS
   ================================================================= */
.mob-head-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff7ed;
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: #1e1b18;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.mob-head-icon-btn:hover,
.mob-head-icon-btn:active {
    background: #ffedd5;
    color: #d97706;
}
.mob-head-icon-btn .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
    line-height: 1;
}

@media (max-width: 767.98px) {
    .btn-add-cart, .btn-hero, .btn-checkout, .btn-filter,
    .cart-icon-btn, .mobile-nav-item, .mob-head-icon-btn {
        min-height: 40px !important;
    }
}

