/* Mobile overrides only: desktop category templates and header keep their layout. */
.store-categories-mobile { display: none; }

@media (min-width: 992px) {
    .tp-store-image-area { padding-top: 0 !important; margin-top: 0 !important; }
    .tp-store-banner,
    .tp-store-banner .owl-stage-outer,
    .tp-store-banner .tp-store-banner-slide,
    .tp-store-banner .tp-store-banner-slide img {
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .tp-store-image-area { padding-top: 8px !important; margin-top: 0 !important; }
    /* Keep each stacked label flush with the physical left edge on mobile. */
    .tp-product-badge,
    .tp-product-badge-3 {
        left: 0 !important;
        right: auto !important;
        align-items: flex-start !important;
    }
    [dir="rtl"] .tp-product-badge,
    [dir="rtl"] .tp-product-badge-3 { align-items: flex-end !important; }
    .store-categories-desktop { display: none !important; }
    .store-categories-mobile { display: block; }
    .store-category-section { padding-block: 20px; }
    .store-category-mobile-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }
    .store-category-mobile-card {
        min-width: 0;
        aspect-ratio: 1;
        display: flex;
        flex-direction: column;
        text-align: center;
        background: var(--tp-common-white, #fff);
        color: var(--tp-common-black, #010f1c);
        border: 1px solid var(--tp-border-primary, #eaebed);
        border-radius: 8px;
        padding: 6px;
        overflow: hidden;
    }
    .store-category-mobile-image {
        display: flex;
        flex: 1;
        min-height: 0;
        align-items: center;
        justify-content: center;
        width: 100%;
        overflow: hidden;
    }
    .store-category-mobile-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .store-category-mobile-name {
        font-size: 12px;
        font-weight: 500;
        line-height: 1.5;
        margin-top: 6px;
        overflow-wrap: anywhere;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .store-category-mobile-count { font-size: 11px; line-height: 1.5; opacity: .75; }

    /* Keep 44px touch targets while reducing the logo/menu row to about 56px. */
    /* The theme writes a measured height inline once; don't retain an old mobile height. */
    header .tp-header-height { height: auto !important; min-height: 56px; }
    header .tp-header-height:has(> .store-header-top .ae-anno-announcement-wrapper:not(.hide-on-mobile)) { min-height: 86px; }
    header .tp-header-main,
    header .tp-header-bottom-2,
    header .tp-header-bottom-3,
    header .tp-header-bottom-4,
    header .tp-header-5,
    .tp-header-sticky-area {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
    header .tp-header-main > .container > .row,
    header .tp-header-bottom-2 .row,
    header .tp-header-bottom-3 .row,
    header .tp-header-bottom-4 .row,
    header .tp-header-5 .row { min-height: 44px; }
    header .logo, .tp-header-sticky-area .logo { display: flex; align-items: center; margin-block: 0; }
    header .logo a, .tp-header-sticky-area .logo a { display: inline-flex; align-items: center; }
    header .logo img, .tp-header-sticky-area .logo img {
        --store-responsive-logo-height: 32px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
    header .tp-header-action-btn,
    .tp-header-sticky-area .tp-header-action-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        line-height: 1;
        vertical-align: middle;
    }
    header .tp-header-action,
    .tp-header-sticky-area .tp-header-action {
        align-items: center;
        gap: 4px;
        margin-inline: 0 !important;
    }
    header .tp-header-action .tp-header-action-item,
    .tp-header-sticky-area .tp-header-action .tp-header-action-item {
        display: flex;
        align-items: center;
        height: 44px;
        margin: 0;
    }
    header .tp-header-action-btn > svg,
    .tp-header-sticky-area .tp-header-action-btn > svg { display: block; flex-shrink: 0; }
    header .tp-header-action .tp-header-action-badge,
    .tp-header-sticky-area .tp-header-action .tp-header-action-badge {
        top: 0;
        right: 0;
        left: auto;
        width: 18px;
        height: 18px;
        line-height: 14px;
        font-size: 10px;
    }
    header .tp-header-main > .container > .row > :first-child { flex: 0 0 44%; width: 44%; }
    header .tp-header-main > .container > .row > :last-child { flex: 1; width: auto; min-width: 0; }

    .store-header-news { width: 100%; min-width: 0; }
    .store-header-top .ae-anno-announcement-wrapper {
        min-height: 30px;
        padding-top: 4px;
        padding-bottom: 4px;
        overflow: hidden;
    }
    .store-header-top .ae-anno-announcement__items { flex-wrap: nowrap; min-width: 0; gap: 6px; }
    .store-header-top .ae-anno-announcement { min-width: 0; flex: 1; overflow: hidden; direction: ltr; }
    .store-header-top .ae-anno-announcement__controls { flex-shrink: 0; }
    .store-header-top .ae-anno-announcement__content {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        width: max-content;
        max-width: none;
        white-space: nowrap;
        direction: rtl;
        margin: 0;
        font-size: 12px;
        line-height: 22px;
        animation: store-mobile-news 18s linear infinite;
    }
    .store-header-top .ae-anno-announcement__text,
    .store-header-top .ae-anno-announcement__button { white-space: nowrap; font-size: inherit; line-height: inherit; margin: 0; flex-shrink: 0; }
    .store-header-top .ae-anno-announcement__text br { display: none; }
    .store-header-top .ae-anno-announcement__text * { white-space: nowrap; }
    .store-header-top .ae-anno-announcement-wrapper:hover .ae-anno-announcement__content,
    .store-header-top .ae-anno-announcement-wrapper:focus-within .ae-anno-announcement__content { animation-play-state: paused; }
    /* Transparent header variants sit directly below the compact news strip. */
    header:has(.store-header-news .ae-anno-announcement-wrapper:not(.hide-on-mobile)) .tp-header-transparent { top: 30px; }
    @keyframes store-mobile-news {
        from { transform: translateX(calc(100vw - 100% - 48px)); }
        to { transform: translateX(100vw); }
    }
}

@media (max-width: 359.98px) {
    .store-category-mobile-grid { gap: 6px; }
    .store-category-mobile-card { padding: 4px; }
    .store-category-mobile-name { font-size: 11px; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .store-header-top .ae-anno-announcement { overflow-x: auto; }
    .store-header-top .ae-anno-announcement__content { animation: none; transform: none; }
}
