/* Responsive overrides for megamart/home layout.
   This file is loaded after style.css to avoid editing existing rules. */

/* Hero Section Full Width on Desktop/Laptop */
.section-hero {
    max-width: 100% !important;
    margin-top: 0 !important;
}

/* Login page image sizing (required 500x500) */
/* Customer/Seller auth pages use images with `class="img-fit h-100"`.
   Enforce a consistent visual size while keeping object-fit cover. */
.auth-login-page-visual.img-fit.h-100,
.auth-login-page-visual {
    width: 500px !important;
    height: 500px !important;
    max-width: 500px !important;
    max-height: 500px !important;
    object-fit: cover !important;
}

@media (max-width: 767px) {
    /* On small screens keep a stable square height/width.
       Only width changes to full-container; height remains 500px per requirement. */
    .auth-login-page-visual.img-fit.h-100,
    .auth-login-page-visual {
        width: 100% !important;
        height: 500px !important;
        max-width: 100% !important;
        max-height: 500px !important;
    }
}

/* Login hero image inside modal (if the modal shows an img) */
#login_modal img,
#login_modal .auth-login-page-visual {
    width: 500px !important;
    height: 500px !important;
    max-width: 500px !important;
    max-height: 500px !important;
    object-fit: cover !important;
}

.hero-intro {
    justify-content: center;
}

/* Hero Images Responsive */
.hero-badge img,
.hero-wave,
.ls-characters,
.ls-barn,
.hero-union,
.floating-circle,
.ls-hill {
    max-width: 100%;
    height: auto;
}

/* Hero landscape images responsive positioning */
/* Hero mobile sizing: hero-section-responsive.css */

@media (max-width: 1366px) {
    .header-main {
        padding: 12px 24px;
    }

    .header-nav {
        padding: 0 24px;
    }

    .header-main__logo-icon img {
        width: 180px;
        height: auto;
    }

    .header-nav__links {
        gap: 18px;
    }

    .hero-title {
        font-size: 56px;
        line-height: 1.15;
    }

    .categories-arc-container {
        max-width: 820px;
        height: 470px;
        margin-top: 110px;
    }

    .categories-arc-container::before {
        width: 700px;
        height: 700px;
    }

    .categories-center {
        width: 400px;
        bottom: -110px;
    }

    .footer-brand__logo-icon {
        width: 320px;
        height: 56px;
    }

    .footer-top {
        gap: 40px;
        grid-template-columns: 1.4fr repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 1199px) {
    body {
        max-width: 100%;
    }

    .header-main,
    .header-nav,
    .site-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .header-main {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .header-actions {
        margin-left: auto;
    }

    .header-nav {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-nav__left,
    .header-nav__contact {
        flex: 0 0 auto;
    }

    .header-nav__links {
        flex: 1 1 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 12px 18px;
    }

    .categories-arc-container {
        transform: scale(0.8);
        transform-origin: top center;
        margin-top: 48px;
        margin-bottom: -50px;
    }

    .flash-wrapper {
        grid-template-columns: 1fr;
    }

    .flash-products {
        padding: 24px;
    }

    .flash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reality-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .footer-middle {
        flex-direction: column;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

@media (max-width: 991px) {
    .header-main__logo-icon img {
        width: 150px;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-wave {
        width: 100%;
        max-width: 240px;
    }

    .flash-grid,
    .reality-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flash-products-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .reality-header-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .kitchen-line,
    .basket-card-line,
    .pillar-card-line {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    /* Hero Section Tablet Optimizations */
    .hero-badge img {
        width: 140px !important;
        max-width: 140px !important;
    }

    .hero-wave {
        width: 260px !important;
        max-width: 260px !important;
        margin-top: 35px !important;
    }

    .hero-shop-btn {
        font-size: 12px !important;
        padding: 5px 14px !important;
        min-width: 70px !important;
        min-height: 30px !important;
        max-width: 130px !important;
        height: 30px !important;
        line-height: 30px !important;
    }

    .hero-shop-btn i {
        font-size: 0.7em !important;
        margin-left: 2px !important;
    }

    .hero-intro__container {
        padding: 0 30px !important;
    }
}

@media (max-width: 767px) {
    /* Hero Section Mobile Optimizations */
    .hero-badge img {
        width: 110px !important;
        max-width: 110px !important;
    }

    .hero-wave {
        width: 160px !important;
        max-width: 160px !important;
        margin-top: 15px !important;
    }

    .hero-desc {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    .hero-shop-btn {
        font-size: 11px !important;
        padding: 4px 10px !important;
        min-width: 50px !important;
        min-height: 26px !important;
        max-width: 110px !important;
        margin-top: 8px !important;
        height: 26px !important;
        line-height: 26px !important;
    }

    .hero-shop-btn i {
        font-size: 0.7em !important;
        margin-left: 2px !important;
    }

    .header-mobile-toggle {
        display: flex !important;
        background: var(--white);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        padding: 0;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        position: relative;
        z-index: 10001;
    }

    .header-mobile-toggle span {
        width: 20px;
        height: 2px;
        background-color: var(--primary-color);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
    }

    .header-mobile-toggle.is-active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .header-mobile-toggle.is-active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-10px);
    }

    .header-mobile-toggle.is-active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* Offcanvas Sidebar Menu */
    .header-nav {
        position: fixed !important;
        top: 0;
        right: -100% !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        background-color: var(--white) !important;
        z-index: 100000 !important; /* Extremely high z-index */
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 80px 24px 24px !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2) !important;
        border: none !important;
        overflow-y: auto !important;
        visibility: visible !important;
    }

    .header-nav.is-open {
        right: 0 !important;
    }

    /* Menu Overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden !important;
    }

    /* Ensure offcanvas menu hidden by default on mobile and shown when open */
    .header-nav {
        right: -100% !important;
    }

    .header-nav__links,
    .header-nav__left,
    .header-nav__contact {
        width: 100% !important;
    }

    /* Overlay click target should be visible when active */
    #nav-overlay {
        display: block;
    }

    body.nav-open #nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    .header-nav__links {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        width: 100% !important;
    }

    .header-nav__link {
        width: 100% !important;
        padding: 16px 0 !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border-bottom: 1px solid #f8f9fa !important;
        color: var(--dark-color) !important;
    }

    .header-nav__link--active {
        color: var(--primary-color) !important;
    }

    .header-nav__link--active::after {
        display: none !important;
    }

    .header-nav__contact {
        margin-top: auto !important;
        padding: 24px 0 !important;
        border-top: 2px solid #f8f9fa !important;
        justify-content: flex-start !important;
    }

    .header-actions__icon-btn {
        font-size: 20px;
    }

    .header-actions__badge {
        right: -6px;
    }

    /* Mobile Header Layout Refinement */
    .header-main {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 16px !important;
    }

    .header-main__logo {
        order: 2;
        flex: 1;
        display: flex;
        justify-content: center;
        margin: 0;
    }

    .header-mobile-buttons {
        order: 1;
        flex: 0 0 auto;
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        align-items: flex-start !important;
    }

    .header-mobile-cat-toggle,
    .mobile-cat-popup {
        display: none !important;
    }

    .header-actions {
        order: 3;
        flex: 0 0 auto;
        margin-left: 0 !important;
    }

    .header-search {
        order: 4;
        width: 100% !important;
        margin-top: 10px !important;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-brand__logo-icon {
        width: 260px;
        height: 48px;
    }

    .payment-pill {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }
}

@media (max-width: 575px) {
    .section-categories,
    .section-pillars,
    .section-baskets,
    .section-reality,
    .section-flash-deals,
    .section-amazon,
    .section-clients,
    .section-ready,
    .section-journey {
        padding-left: 16px;
        padding-right: 16px;
    }

    .flash-products {
        padding: 16px;
    }

    .header-main,
    .header-nav,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-nav__left {
        display: none !important; /* Hidden on mobile as per user request (redundant) */
    }

    .header-nav__categories-btn {
        width: 100% !important;
        justify-content: space-between !important;
        background: #f8f9fa !important;
        border: 1px solid #eee !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        font-weight: 700 !important;
        color: var(--primary-color) !important;
    }

    .header-nav__categories-btn:hover {
        background: var(--primary-color) !important;
        color: #fff !important;
    }

    .header-nav__categories-btn:hover .ph-list {
        color: #fff !important;
    }

    .header-mobile-cat-toggle {
        background: var(--white);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary-color);
        font-size: 24px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-cat-popup {
        width: 280px;
        border-radius: 12px;
        border: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        padding: 12px 0;
        margin-top: 10px !important;
    }

    .mobile-cat-popup .dropdown-item {
        padding: 12px 20px;
        font-weight: 500;
        font-size: 14px;
        border-bottom: 1px solid #f8f9fa;
    }

    .mobile-cat-popup .dropdown-item:last-child {
        border-bottom: none;
    }

    .header-mobile-cat-toggle,
    .mobile-cat-popup {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .section-categories {
        overflow: hidden !important;
        padding-top: 32px !important;
        padding-bottom: 24px !important;
    }

    .categories-header {
        padding: 0 8px;
    }

    .categories-title {
        font-size: 28px !important;
        line-height: 1.2 !important;
    }

    .categories-subtitle {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .categories-arc-container {
        width: 950px !important;
        max-width: 950px !important;
        height: 520px !important;
        left: 50% !important;
        margin: 28px 0 -120px -475px !important;
        transform: scale(0.58) !important;
        transform-origin: top center !important;
    }

    .categories-arc-container::before {
        width: 850px !important;
        height: 850px !important;
    }

    .category-item {
        width: 170px !important;
    }

    .category-frame {
        width: 170px !important;
        height: 170px !important;
        background-size: contain !important;
        position: relative !important;
        overflow: hidden !important;
        border-radius: 50% !important;
    }

    .category-frame img {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        width: 72% !important;
        height: 72% !important;
        max-width: 72% !important;
        max-height: 72% !important;
        transform: translate(-50%, -50%) !important;
        object-fit: contain !important;
        object-position: center !important;
        display: block !important;
        border-radius: 50% !important;
    }

    .category-item span {
        font-size: 22px !important;
        line-height: 1.15 !important;
        margin-top: 12px !important;
    }

    .pos-1 { left: 60px !important; top: 68% !important; }
    .pos-2 { left: 18% !important; top: 10% !important; }
    .pos-3 { left: 42% !important; top: -8% !important; }
    .pos-4 { right: 10% !important; top: 12% !important; }
    .pos-5 { right: 55px !important; top: 69% !important; }
}

@media (max-width: 575px) {
    .section-categories {
        padding-top: 28px !important;
        padding-bottom: 18px !important;
    }

    .categories-title {
        font-size: 24px !important;
    }

    .categories-arc-container {
        margin-top: 22px !important;
        margin-bottom: -188px !important;
        transform: scale(0.45) !important;
    }

    .category-item {
        width: 176px !important;
    }

    .category-frame {
        width: 176px !important;
        height: 176px !important;
    }

    .category-item span {
        font-size: 24px !important;
        line-height: 1.12 !important;
        margin-top: 12px !important;
    }

     .pos-1 { left: 8px !important; top:70% !important; }
    .pos-2 { left: 8% !important; top: 0% !important; }
    .pos-3 { left: 45% !important; top: -12% !important; }
    .pos-4 { right: 10% !important; top: 20% !important; }
    .pos-5 { right: 8px !important; top: 75% !important; }
}

@media (max-width: 380px) {
    .categories-arc-container {
        margin-bottom: -205px !important;
        transform: scale(0.41) !important;
    }
}

@media (max-width: 767px) {
    .header-nav {
        align-items: stretch !important;
        gap: 0 !important;
    }

    .header-nav.is-open {
        display: flex !important;
        right: 0 !important;
        padding: 80px 22px 24px !important;
    }

    .header-nav__left {
        display: none !important;
    }

    .header-nav__left .dropdown,
    .header-nav__categories-btn {
        width: 100% !important;
    }

    .header-nav__links {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .header-nav__links li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .header-nav__link {
        display: flex !important;
        align-items: center !important;
        min-height: 46px !important;
        width: 100% !important;
        padding: 12px 4px !important;
        color: var(--dark-color) !important;
        text-decoration: none !important;
        white-space: normal !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .header-nav__contact {
        flex: 0 0 auto !important;
        margin-top: 18px !important;
    }
}

/* Amazon Card Centering Fixes */
@media (max-width: 768px) {
    .amazon-card {
        padding: 20px 12px;
    }

    .amazon-logo-wrapper {
        width: 60px;
        height: 60px;
        margin: 0 auto 12px auto;
    }

    .amazon-brand {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .amazon-cat {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    /* Hero Section Extra Small Mobile */
    .hero-badge img {
        width: 80px !important;
        max-width: 80px !important;
    }

    .hero-wave {
        width: 120px !important;
        max-width: 120px !important;
        margin-top: 10px !important;
    }

    .hero-desc {
        font-size: 11px !important;
        margin-bottom: 10px !important;
    }

    .hero-shop-btn {
        font-size: 9px !important;
        padding: 3px 8px !important;
        min-width: 40px !important;
        min-height: 22px !important;
        max-width: 90px !important;
        margin-top: 6px !important;
        height: 22px !important;
        line-height: 22px !important;
    }

    .hero-shop-btn i {
        font-size: 0.65em !important;
        margin-left: 1px !important;
    }

    .amazon-card {
        padding: 16px 10px;
    }

    .amazon-logo-wrapper {
        width: 50px;
        height: 50px;
        margin: 0 auto 10px auto;
    }

    .amazon-brand {
        font-size: 11px;
    }

    .amazon-cat {
        font-size: 9px;
    }
}
