/* Mobile & tablet styles — LuxeShop storefront (max-width, touch) */

@media (max-width: 900px) {
    .mega-menu-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .products-grid--home {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .products-grid--home {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid--home {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .categories-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .categories-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .category-showcase-card {
        flex-basis: calc(33.333% - .55rem);
        min-width: 108px;
        max-width: 140px;
    }

    .category-showcase-name {
        font-size: .78rem;
    }
}

@media (max-width: 380px) {
    .category-showcase-card {
        flex-basis: calc(50% - .45rem);
        max-width: none;
    }
}

@media (max-width: 768px) {
    .testimonials-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .testimonials-score {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: .75rem;
    }

    .testimonials-score-num {
        font-size: 1.6rem;
    }

    .testimonials-rail {
        display: none;
    }

    .testimonials-carousel {
        min-height: 280px;
    }

    .testimonial-text {
        -webkit-line-clamp: 4;
    }
}

@media (max-width: 900px) {
    .content-page-layout {
        grid-template-columns: 1fr;
    }

    .content-page-aside {
        position: static;
    }

    .content-page-hero {
        padding: 2rem 0 1.75rem;
    }

    .content-page-body {
        padding: 2rem 0 3rem;
    }
}

@media(max-width:1024px) {
    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }

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

    .cart-layout {
        grid-template-columns: 1fr 320px;
        gap: 1.5rem;
    }

    .checkout-layout {
        grid-template-columns: 1fr 300px;
        gap: 1.5rem;
    }

    .shop-wrap {
        grid-template-columns: 220px 1fr;
        gap: 1.5rem;
    }
}

@media(max-width:900px) {
    .shop-wrap {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px,88vw);
        z-index: 200;
        border-radius: 0;
        max-height: 100vh;
        transform: translateX(-105%);
        transition: transform .3s ease;
        box-shadow: var(--shadow-lg);
    }

        .filter-panel.open {
            transform: translateX(0);
        }

    .mobile-filter-btn {
        display: inline-flex !important;
    }

    .product-list-item {
        flex-direction: column;
    }

    .product-list-img {
        width: 100%;
        height: 200px;
    }

    .product-list-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 1.25rem 1.25rem;
    }
}

@media(max-width:768px) {
    .main-nav, .header-search {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-inner {
        gap: .75rem;
        padding: 0 1rem;
        height: 56px;
    }

    .logo-text {
        font-size: 1.15rem;
    }

    .header-btn {
        width: 38px;
        height: 38px;
        font-size: .95rem;
    }

    .container, .page-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .announcement-bar {
        font-size: .68rem;
        padding: .35rem 2rem .35rem .75rem;
        text-align: center;
    }

    .hero-section {
        padding-top: .45rem;
    }

    .marquee-wrap {
        padding-top: .45rem;
    }

    .marquee-track {
        padding: .45rem 0;
    }

    .categories-section,
    .categories-section.page-section {
        padding: .65rem 0 .75rem;
    }

    .categories-section-head {
        margin-bottom: .55rem;
        gap: .45rem;
    }

    .categories-progress {
        margin-top: .35rem;
    }

    .home-flash-section {
        padding: .35rem 0 .65rem;
    }

    .home-flash-section .flash-sale {
        padding: .75rem .95rem;
        gap: .5rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .home-flash-section .flash-sale-title {
        font-size: 1rem;
        line-height: 1.15;
    }

    .home-flash-section .flash-sale-sub {
        font-size: .64rem;
        margin-top: .1rem;
        line-height: 1.35;
    }

    .home-flash-section .countdown {
        gap: .45rem;
        width: 100%;
    }

    .home-flash-section .cd-unit {
        min-width: 44px;
        padding: .32rem .5rem;
        border-radius: 8px;
        flex: 1;
    }

    .home-flash-section .cd-num {
        font-size: 1.05rem;
    }

    .home-flash-section .cd-label {
        font-size: .5rem;
    }

    .home-flash-section .flash-sale .btn-primary {
        width: 100%;
        justify-content: center;
        padding: .45rem .75rem;
        font-size: .76rem;
    }

    .home-products-section {
        padding-top: .25rem;
        padding-bottom: 1rem;
    }

    .home-products-section .section-header {
        margin-bottom: .75rem;
        gap: .35rem;
    }

    /* Home product cards — compact mobile layout */
    .products-grid--home {
        gap: .625rem;
    }

    .products-grid--home .product-card {
        border-radius: 12px;
    }

    .products-grid--home .product-card-media,
    .products-grid--home .product-card-img {
        aspect-ratio: 1 / 1;
    }

    .products-grid--home .product-card-badges {
        top: .45rem;
        left: .45rem;
        gap: .25rem;
    }

    .products-grid--home .badge {
        padding: .16rem .42rem;
        font-size: .6rem;
    }

    .products-grid--home .product-card-actions {
        top: .4rem;
        right: .4rem;
        flex-direction: row;
        gap: .28rem;
    }

    .products-grid--home .card-action-btn {
        width: 30px;
        height: 30px;
        font-size: .76rem;
        box-shadow: 0 2px 8px rgba(0,0,0,.1);
    }

    .products-grid--home .product-card-body {
        padding: .5rem .6rem 0;
        gap: .18rem;
    }

    .products-grid--home .product-card-category {
        font-size: .6rem;
        letter-spacing: .045em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .products-grid--home .product-card-name {
        font-size: .8rem;
        line-height: 1.32;
        -webkit-line-clamp: 2;
    }

    .products-grid--home .product-card-desc {
        font-size: .68rem;
        line-height: 1.35;
        -webkit-line-clamp: 1;
    }

    .products-grid--home .product-card-rating {
        margin-top: 0;
        padding-top: .15rem;
        gap: .22rem;
    }

    .products-grid--home .stars,
    .products-grid--home .rating-count {
        font-size: .64rem;
    }

    .products-grid--home .product-card-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .45rem;
        padding: .42rem .6rem .55rem;
        margin-top: .28rem;
        border-top: 1px solid var(--border);
    }

    .products-grid--home .product-card-bottom .product-card-price {
        margin: 0;
        padding: 0;
        flex: 1;
        min-width: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: .06rem;
    }

    .products-grid--home .product-card-bottom .price-current {
        font-size: .84rem;
        line-height: 1.15;
    }

    .products-grid--home .product-card-bottom .price-original {
        font-size: .66rem;
        line-height: 1.15;
    }

    .products-grid--home .product-card-bottom .product-card-footer {
        padding: 0;
        flex-shrink: 0;
    }

    .products-grid--home .product-card-bottom .add-to-cart-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 9px;
        gap: 0;
        flex-shrink: 0;
    }

    .products-grid--home .product-card-bottom .add-to-cart-btn span {
        display: none;
    }

    .products-grid--home .product-card-bottom .add-to-cart-btn i {
        font-size: .88rem;
    }

    .page-section {
        padding: 2.5rem 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
        margin-bottom: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(2,1fr);
        gap: .75rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3,1fr);
        gap: .75rem;
    }

    .promo-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-main {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .swiper-hero {
        height: clamp(142px, 25.2vh, 202px);
    }

    .hero-frame {
        border-radius: 16px;
    }

    .hero-content {
        padding: .75rem .85rem .65rem;
        max-width: 100%;
    }

    .hero-badge {
        margin-bottom: .35rem;
        padding: .2rem .55rem;
        font-size: .6rem;
    }

    .hero-title {
        font-size: 1.2rem;
        margin-bottom: .3rem;
        line-height: 1.12;
    }

    .hero-desc {
        display: none;
    }

    .hero-btns {
        margin-top: .15rem;
    }

        .hero-btns .btn-primary,
        .hero-btns .hero-btn-compact {
            width: auto;
            align-self: flex-start;
            flex: 0 0 auto;
            padding: .38rem .72rem;
            font-size: .7rem;
            border-radius: 8px;
            gap: .35rem;
        }

            .hero-btns .btn-primary i {
                font-size: .72rem;
            }

    .swiper-hero .swiper-pagination {
        bottom: .35rem !important;
    }

    .swiper-hero .swiper-pagination-bullet {
        width: 5px;
        height: 5px;
    }

    .swiper-hero .swiper-pagination-bullet-active {
        width: 14px;
    }

    .swiper-hero .swiper-button-next,
    .swiper-hero .swiper-button-prev {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        margin-top: 0;
        top: 50%;
        transform: translateY(-50%);
    }

        .swiper-hero .swiper-button-next:hover,
        .swiper-hero .swiper-button-prev:hover {
            transform: translateY(-50%) scale(1.04);
        }

        .swiper-hero .swiper-button-next::after,
        .swiper-hero .swiper-button-prev::after {
            font-size: .58rem;
            font-weight: 800;
        }

    .swiper-hero .swiper-button-prev {
        left: .35rem;
    }

    .swiper-hero .swiper-button-next {
        right: .35rem;
    }

    .categories-nav {
        padding: .12rem;
        gap: .2rem;
        border-radius: 9px;
    }

    .cat-nav-btn {
        width: 26px;
        height: 26px;
        border-radius: 7px;
        font-size: .72rem;
    }

    .category-showcase-media {
        aspect-ratio: 4 / 3;
    }

    .category-showcase-caption {
        padding: .4rem .45rem .45rem;
    }

    .category-showcase-initial {
        font-size: 1.75rem;
        top: .25rem;
        right: .35rem;
    }

    .category-showcase-name {
        font-size: .7rem;
        line-height: 1.25;
        -webkit-line-clamp: 2;
    }

    .category-showcase-count {
        margin-top: .1rem;
        font-size: .58rem;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

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

    .trust-item {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

        .trust-item:nth-child(odd) {
            border-right: 1px solid var(--border);
        }

        .trust-item:nth-last-child(-n+2) {
            border-bottom: none;
        }

    .flash-sale {
        padding: .75rem .95rem;
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

        .flash-sale .btn-primary {
            width: 100%;
            justify-content: center;
            padding: .45rem .75rem;
            font-size: .76rem;
        }

    .home-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tab-pills {
        width: 100%;
        justify-content: flex-start;
        border-radius: 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .tab-pills::-webkit-scrollbar {
            display: none;
        }

    .site-footer {
        margin-top: 2.5rem;
    }

    .cart-layout, .checkout-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cart-summary, .checkout-summary {
        position: static;
        order: -1;
    }

    .cart-item {
        display: grid;
        grid-template-columns: 64px 1fr auto;
        grid-template-rows: auto auto;
        gap: .65rem .75rem;
        padding: 1rem;
        align-items: center;
    }

    .cart-item-img {
        width: 64px;
        height: 64px;
        grid-row: span 2;
    }

    .cart-item-body {
        grid-column: 2;
    }

    .cart-qty-wrap {
        grid-column: 2;
        justify-self: start;
    }

    .cart-item-subtotal {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
        border: none;
        margin: 0;
        padding: 0;
        font-size: .9rem;
        align-self: start;
    }

    .cart-item > button:last-child {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    .checkout-city-grid {
        grid-template-columns: 1fr;
    }

    .checkout-card {
        padding: 1.25rem;
    }

    .account-wrap {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem 0;
    }

    .account-sidebar {
        position: static;
        display: none;
    }

    .account-mobile-nav {
        display: flex;
    }

    #ordersList,
    .content-panel {
        min-width: 0;
    }

    .stat-chips {
        grid-template-columns: repeat(3,1fr);
        gap: .5rem;
    }

    .stat-chip .num {
        font-size: 1.25rem;
    }

    .order-row {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    #toastContainer {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .product-card-body {
        padding: .7rem .65rem .55rem;
    }

    .product-card-footer {
        padding: 0 .65rem .7rem;
    }

    .product-card-bottom .product-card-price {
        padding: 0 .65rem .28rem;
        margin-top: .1rem;
    }

    .product-card-bottom .product-card-footer {
        padding: 0 .65rem .7rem;
    }

    .product-card-desc {
        -webkit-line-clamp: 1;
        font-size: .7rem;
    }

    .add-to-cart-btn {
        font-size: .76rem;
        padding: .55rem .5rem;
        border-radius: 10px;
    }

    .add-to-cart-btn span {
        display: inline;
    }

    .product-card-actions {
        opacity: 1;
        transform: none;
        flex-direction: row;
        top: .5rem;
        right: .5rem;
        bottom: auto;
    }

    .card-action-btn {
        width: 32px;
        height: 32px;
        font-size: .82rem;
    }

    .product-card-media {
        aspect-ratio: 4 / 5;
    }

    .product-card-img {
        aspect-ratio: 4 / 5;
    }
}

@media(max-width:480px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

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

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-section {
        padding: 2rem 1.25rem;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .trust-grid {
        grid-template-columns: 1fr;
    }

    .trust-item, .trust-item:nth-child(odd) {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: .875rem 0;
    }

        .trust-item:last-child {
            border-bottom: none;
        }

    .countdown {
        width: 100%;
        justify-content: center;
        gap: .45rem;
    }

    .cd-unit {
        min-width: 44px;
        padding: .32rem .5rem;
        flex: 1;
        border-radius: 8px;
    }

    .cd-num {
        font-size: 1.05rem;
    }

    .cd-label {
        font-size: .5rem;
    }

    .flash-sale-title {
        font-size: 1rem;
        line-height: 1.15;
    }

    .flash-sale-sub {
        font-size: .64rem;
        margin-top: .1rem;
    }

    .stat-chips {
        grid-template-columns: 1fr;
    }

    .cart-qty-wrap {
        width: auto;
        justify-content: flex-start;
    }

    .cart-coupon-row {
        flex-direction: column;
    }

        .cart-coupon-row .btn-outline {
            width: 100%;
        }

    .checkout-pay-option {
        padding: .75rem;
        gap: .75rem;
    }

    .pagination {
        gap: .3rem;
    }

    .page-btn {
        width: 34px;
        height: 34px;
        font-size: .8rem;
    }

    .shop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

        .shop-toolbar > div:last-child {
            justify-content: space-between;
            width: 100%;
        }

    .promo-card {
        min-height: 140px;
        padding: 1.5rem;
    }

    .testimonial-card {
        padding: 1.25rem;
    }

    .page-title {
        margin-bottom: 1.25rem;
    }

    .empty-state-page {
        padding: 3rem 1rem;
    }
}

@media(max-width:360px) {
    .header-inner {
        padding: 0 .75rem;
        gap: .5rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .products-grid {
        gap: .5rem;
    }

    .product-card-name {
        font-size: .8rem;
        -webkit-line-clamp: 2;
    }

    .price-current {
        font-size: .88rem;
    }

    .product-card-footer {
        padding: 0 .5rem .6rem;
    }

    .add-to-cart-btn span {
        font-size: .72rem;
    }

    .product-card-rating {
        display: none;
    }

    .products-grid--home .product-card-rating {
        display: flex;
    }
}

@media (max-width: 767.98px) {
    .trust-bar {
        display: none;
    }
}

@media (hover: none), (max-width: 768px) {
    .product-card-actions {
        opacity: 1;
        transform: none;
    }

    .product-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .product-card:active {
        transform: scale(.985);
    }
}

@media (max-width: 768px) {
    .product-list-item {
        flex-direction: row;
        align-items: stretch;
        border-radius: 14px;
        padding: 0;
    }

    .product-list-img {
        width: 112px;
        min-height: 112px;
        height: auto;
        align-self: stretch;
    }

        .product-list-img img {
            width: 100%;
            height: 100%;
            min-height: 112px;
            object-fit: cover;
        }

    .product-list-body {
        padding: .85rem .75rem .85rem 0;
        min-width: 0;
    }

    .product-list-actions {
        display: none;
    }

    .products-list-view {
        gap: .65rem;
    }
}

@media (max-width: 768px) {
    :root {
        --mobile-tab-h: 46px;
    }

    .mobile-tab-bar {
        display: block;
    }

    body.storefront-mobile-nav {
        padding-bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
    }

    #toastContainer {
        bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .product-detail-page {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        padding-bottom: calc(5.5rem + var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
    }

    .product-gallery-main {
        aspect-ratio: 1;
        max-height: none;
        border-radius: 18px;
        box-shadow: var(--shadow-md);
    }

    .product-info-block {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 1.25rem;
        box-shadow: var(--shadow-sm);
    }

    .product-detail-price-row {
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .product-detail-actions {
        display: none;
    }

    .product-mobile-buybar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
        z-index: 110;
        padding: .75rem 1.25rem;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 28px rgba(0,0,0,.08);
    }

    [data-theme="dark"] .product-mobile-buybar {
        background: rgba(15,15,26,.96);
    }

    .product-mobile-buybar-price {
        display: flex;
        flex-direction: column;
        gap: .1rem;
        min-width: 0;
    }

        .product-mobile-buybar-price span {
            font-size: .65rem;
            text-transform: uppercase;
            letter-spacing: .05em;
            color: var(--text-muted);
            font-weight: 600;
        }

        .product-mobile-buybar-price strong {
            font-size: 1.1rem;
            color: var(--accent);
            line-height: 1.1;
        }

    .product-mobile-buybar .btn-primary {
        flex-shrink: 0;
        min-width: 140px;
        padding: .7rem 1rem;
    }

    .product-mobile-buybar-wish {
        width: 44px;
        height: 44px;
        padding: 0;
        flex-shrink: 0;
    }

    .breadcrumb-nav {
        font-size: .75rem;
        margin-bottom: 1rem;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .15rem;
    }

    .product-detail-tabs {
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .product-detail-related {
        margin-top: 2rem;
    }

    .cart-mobile-checkout {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--mobile-tab-h) + env(safe-area-inset-bottom, 0px));
        z-index: 110;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .75rem 1rem;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px rgba(0,0,0,.08);
    }

    [data-theme="dark"] .cart-mobile-checkout {
        background: rgba(15,15,26,.96);
    }

    .cart-mobile-checkout-total {
        display: flex;
        flex-direction: column;
        gap: .1rem;
        min-width: 0;
    }

        .cart-mobile-checkout-total span {
            font-size: .68rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .05em;
            font-weight: 600;
        }

        .cart-mobile-checkout-total strong {
            font-size: 1.05rem;
            color: var(--accent);
        }

    .cart-mobile-checkout .btn-primary {
        flex-shrink: 0;
        padding: .65rem 1.1rem;
        white-space: nowrap;
    }

    .cart-layout.has-mobile-bar {
        padding-bottom: 4.5rem;
    }

    .mobile-tab {
        -webkit-tap-highlight-color: transparent;
    }
}
