/* Site fixes — keep this file when installing new scripts */

/* Horizontal promo banners: full image on mobile */
.promo-banner,
.app-home .promo-banner {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: none !important;
    background-image: none !important;
}

.promo-banner-img,
.app-home .promo-banner-img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
}

/* Fallback if old background-image markup still exists */
.promo-banner[style*="background-image"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 5;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

@media (max-width: 900px) {
    .promo-banner[style*="background-image"] {
        aspect-ratio: 16 / 7;
    }
}

html.gt-wait body {
    visibility: hidden !important;
}
html.gt-ready body {
    visibility: visible !important;
}

.goog-te-banner-frame,
.goog-te-balloon-frame,
iframe.skiptranslate,
body > .skiptranslate,
#google_translate_element {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

body {
    top: 0 !important;
}

/* Daraz-style header — exact orange bar, not sticky */
.site-header,
.app-home .site-header,
.app-home .site-header.is-scrolled {
    --header-orange: var(--primary);
    --header-search-btn: color-mix(in srgb, var(--primary) 28%, #fff);
    background: var(--primary) !important;
    border-bottom: none !important;
    position: relative !important;
    top: auto !important;
    box-shadow: none !important;
}

.app-home .mobile-category-scroll {
    position: relative !important;
    top: auto !important;
}

.header-topline {
    display: none;
    background: transparent;
}

.header-topline-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 0;
    padding: 0 0 8px;
}

.header-topline-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
}

.header-topline-links a,
.header-topline-right a {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    opacity: 1;
}

.header-topline-links a:hover,
.header-topline-right a:hover {
    text-decoration: underline;
}

.header-topline-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.header-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    line-height: 1.15;
    opacity: 1 !important;
}

.header-app-btn i {
    color: var(--primary-light);
    font-size: 16px;
}

.header-app-btn .header-app-fav {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.header-app-btn:hover {
    background: var(--primary-dark) !important;
    text-decoration: none !important;
}

.header-inner {
    gap: 28px;
    padding: 8px 0 16px;
}

.logo img {
    height: 40px;
    max-height: 40px;
    width: auto;
}

.header-auth {
    display: none;
    align-items: center;
    gap: 10px;
    color: #fff;
    white-space: nowrap;
}

.header-auth-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.header-auth-link:hover {
    color: #fff;
    opacity: 0.88;
}

.header-auth-sep {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    font-size: 16px;
}

.site-header .cart-btn {
    background: transparent;
    color: #fff;
    padding: 4px 2px;
    gap: 0;
}

.site-header .cart-btn .cart-amount {
    display: none;
}

.site-header .cart-btn i {
    font-size: 24px;
    font-weight: 400;
}

.site-header .cart-count {
    top: -7px;
    right: -9px;
    background: #fff;
    color: var(--primary);
    border: none;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
}

.site-header .menu-toggle {
    color: #fff;
}

@media (min-width: 901px) {
    .header-topline {
        display: block;
    }

    .site-header .lang-switcher {
        display: block;
    }

    .site-header .header-search {
        display: flex;
        align-items: center;
        position: relative;
        flex: 1 1 auto;
        width: auto;
        max-width: 760px;
        min-width: 280px;
        height: 44px;
        background: #fff;
        border: none;
        border-radius: 20px;
        padding: 0 6px 0 18px;
        margin: 0;
        box-shadow: none;
    }

    .site-header .header-search:focus-within {
        border: none;
        box-shadow: none;
    }

    .site-header .header-search input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 14px;
        color: #333;
        min-width: 0;
        height: 100%;
    }

    .site-header .header-search input::placeholder {
        color: #9aa0a6;
    }

    .site-header .header-search .search-camera {
        display: none;
    }

    .site-header .header-search .search-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 34px;
        border: none;
        background: color-mix(in srgb, var(--primary) 28%, #fff);
        color: var(--primary);
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
        font-size: 16px;
        padding: 0;
    }

    .site-header .header-search .search-icon:hover {
        background: color-mix(in srgb, var(--primary) 38%, #fff);
        color: var(--primary);
    }

    .header-auth {
        display: inline-flex;
    }

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

@media (max-width: 900px) {
    .app-home .site-header {
        background: #fff !important;
        box-shadow: none !important;
        position: relative !important;
        top: auto !important;
    }

    .app-home .menu-toggle {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
    }

    .app-home .logo img {
        height: 36px;
        max-width: 160px;
    }

    .app-home .header-actions .header-auth {
        display: none;
    }

    .app-home .lang-switcher-btn {
        background: rgba(255, 255, 255, 0.16);
        border-color: transparent;
        color: #fff;
    }

    .app-home .lang-switcher-btn .lang-icon {
        color: #fff;
    }

    .app-home .cart-btn {
        background: transparent;
        color: #fff;
    }

    .app-home .cart-btn .fa-shopping-cart,
    .app-home .cart-btn .fa-shopping-basket {
        margin: 0;
    }

    .app-home .mobile-search {
        border-color: transparent;
    }
}

/* Home: category card + slider card (Daraz layout) */
.app-home .hero-banner {
    margin: 0 !important;
    padding: 18px 0 12px !important;
    background: #f3f3f3 !important;
}

.home-hero-row {
    display: grid !important;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    align-items: start !important;
}

.home-cat-sidebar {
    position: relative;
    z-index: 8;
    background: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    min-height: 0 !important;
    height: auto !important;
    overflow: visible;
}

.home-cat-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 10px 0 12px;
}

.home-cat-sidebar > ul > li {
    position: relative;
}

.home-cat-sidebar > ul > li > a {
    display: block;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 400;
    color: #4a4a4a;
    line-height: 1.4;
}

.home-cat-sidebar > ul > li > a:hover,
.home-cat-sidebar > ul > li:hover > a {
    color: #f57224;
    background: transparent;
}

.home-cat-flyout {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 8px);
    min-width: 220px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    z-index: 20;
}

.home-cat-sidebar > ul > li:hover .home-cat-flyout {
    display: block;
}

.home-cat-flyout a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #444;
}

.home-cat-flyout a:hover {
    color: #f57224;
    background: #fafafa;
}

.home-cat-flyout a.home-cat-child {
    padding-left: 28px;
    font-size: 12.5px;
    color: #777;
}

.hero-slider-card {
    position: relative;
    min-width: 0;
    background: transparent;
    border-radius: 16px;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
}

.home-hero-row .hero-slider {
    position: relative;
    min-width: 0;
    border-radius: 16px !important;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
}

.home-hero-row .hero-img {
    border-radius: 16px;
    display: block;
    width: 100%;
}

.home-hero-row .hero-nav {
    opacity: 1 !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.home-hero-row .hero-nav:hover {
    background: #fff;
    color: #222;
}

.home-hero-row .hero-prev { left: 12px; }
.home-hero-row .hero-next { right: 12px; }

.hero-slider-card .hero-dots {
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 0;
    z-index: 3;
}

.hero-slider-card .hero-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

.hero-slider-card .hero-dot.active {
    width: 18px !important;
    border-radius: 8px !important;
    background: #fff !important;
}

@media (max-width: 900px) {
    .home-hero-row {
        display: block !important;
        padding: 0;
    }

    .home-cat-sidebar {
        display: none;
    }

    .app-home .hero-banner {
        padding: 0 !important;
        background: transparent !important;
        margin: 0 !important;
    }

    .hero-slider-card {
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }

    .home-hero-row .hero-slider,
    .home-hero-row .hero-img {
        border-radius: 0 !important;
    }

    .hero-slider-card .hero-dots {
        bottom: 10px;
    }
}

.trust-strip {
    padding: 0 0 18px;
    background: #f3f3f3;
}

.trust-strip-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff3eb;
    border-radius: 12px;
    padding: 14px 22px;
    overflow-x: auto;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: center;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    position: relative;
    padding: 0 10px;
}

.trust-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background: #e8cfc0;
}

.trust-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.trust-orange { color: #f57224; }
.trust-teal { color: #0f9d8e; }
.trust-purple { color: #6d28d9; }

@media (max-width: 900px) {
    .trust-strip {
        padding: 10px 0 12px;
        background: #fff;
    }

    .trust-strip-inner {
        justify-content: flex-start;
        padding: 12px 14px;
        border-radius: 0;
    }

    .trust-item {
        flex: 0 0 auto;
        font-size: 12px;
        padding: 0 12px 0 0;
    }

    .trust-item:not(:last-child)::after {
        right: 4px;
    }
}

.home-cat-row {
    background: #f3f3f3;
    padding: 28px 0 18px;
}

.home-cat-slider {
    position: relative;
}

.home-cat-row-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 36px 8px;
}

.home-cat-row-track::-webkit-scrollbar {
    display: none;
}

.home-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 132px;
    width: 132px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 8px 12px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    min-width: 132px;
    scroll-snap-align: start;
}

.home-cat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.home-cat-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f6f6f6;
    margin-bottom: 8px;
}

.home-cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-cat-card-img i {
    font-size: 28px;
    color: #ccc;
}

.home-cat-card-name {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-cat-nav {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #555;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.home-cat-nav:hover {
    background: #fff;
    color: #f57224;
}

.home-cat-prev {
    left: 8px;
}

.home-cat-next {
    right: 8px;
}

body:has(.home-cat-row) .mobile-category-scroll {
    display: none !important;
}

.home-cat-pager,
.fs-va-more {
    display: none;
}

.color-swatch {
    background-image: none !important;
    background-size: auto !important;
}

.color-swatch-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.color-swatch-name {
    font-size: 11px;
    color: #666;
    line-height: 1.2;
    text-align: center;
    max-width: 72px;
}

@media (max-width: 900px) {
    body.app-home {
        background: #f4f4f6;
    }

    .app-home .site-footer {
        display: none !important;
    }

    /* App install card */
    .m-app-card {
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: #fff;
        border: 1px solid #f0f0f0;
        border-radius: 14px;
        padding: 8px 10px 8px 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .m-app-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        text-decoration: none;
        color: inherit;
        flex: 1;
    }

    .m-app-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #fff4ee;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
        border: 1px solid #ffe4d4;
    }

    .m-app-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .m-app-logo i {
        color: var(--primary);
    }

    .m-app-copy {
        display: flex;
        flex-direction: column;
        min-width: 0;
        line-height: 1.2;
    }

    .m-app-copy strong {
        font-size: 14px;
        font-weight: 700;
        color: #222;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .m-app-copy em {
        font-style: normal;
        font-size: 11px;
        color: #8a8a8a;
        font-weight: 500;
    }

    .m-app-open {
        flex-shrink: 0;
        background: var(--primary);
        color: #fff !important;
        font-size: 13px;
        font-weight: 700;
        border-radius: 20px;
        padding: 7px 16px;
        text-decoration: none !important;
        line-height: 1.2;
    }

    /* Pill search + orange Search */
    .app-home .mobile-search,
    .dz-header .mobile-search {
        display: flex !important;
        align-items: center;
        gap: 6px;
        height: 42px;
        background: #fff !important;
        border: 1.5px solid var(--primary) !important;
        border-radius: 22px !important;
        padding: 3px 4px 3px 12px !important;
        box-shadow: none !important;
    }

    .app-home .mobile-search .search-icon {
        order: 0;
        color: #c4c4c4;
        font-size: 14px;
        padding: 0;
        flex-shrink: 0;
        cursor: default;
    }

    .app-home .mobile-search input {
        order: 1;
        font-size: 13px;
        color: #333;
    }

    .app-home .mobile-search input::placeholder {
        color: #b0b0b0;
    }

    .app-home .mobile-search .search-camera,
    .app-home .mobile-search .search-preview {
        display: none !important;
    }

    .m-search-go {
        order: 3;
        border: none;
        background: var(--primary);
        color: #fff;
        font-size: 13px;
        font-weight: 700;
        border-radius: 18px;
        height: 34px;
        padding: 0 16px;
        cursor: pointer;
        flex-shrink: 0;
        font-family: inherit;
    }

    .app-home .mobile-search .mobile-search-results {
        top: calc(100% + 8px);
        left: 0;
        right: 0;
    }

    /* Home stack: slider → categories → promo → flash */
    .app-main {
        display: flex;
        flex-direction: column;
    }

    .app-main > .hero-banner {
        display: block !important;
        order: -30;
    }

    .app-home .hero-banner .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100%;
    }

    .app-main > .trust-strip {
        display: none !important;
    }

    .app-main > .home-cat-row {
        order: -20;
    }

    .app-main > .home-promo-top {
        order: -10;
    }

    /* 5×2 icon categories */
    .home-cat-row {
        background: #fff !important;
        padding: 10px 0 8px !important;
    }

    .home-cat-row .container {
        padding-left: 6px;
        padding-right: 6px;
    }

    .home-cat-row-track {
        display: grid !important;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, auto);
        grid-auto-columns: 20%;
        gap: 6px 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding: 0 2px 4px !important;
    }

    .home-cat-nav {
        display: none !important;
    }

    .home-cat-card {
        flex: none !important;
        width: auto !important;
        min-width: 0 !important;
        flex-basis: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0;
        padding: 4px 2px 6px !important;
        scroll-snap-align: start;
    }

    .home-cat-card-img {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        background: #f7f7f7;
        overflow: hidden;
    }

    .home-cat-card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .home-cat-card-name {
        font-size: 11px !important;
        font-weight: 500;
        color: #555 !important;
        margin-top: 4px;
        -webkit-line-clamp: 2;
    }

    .home-cat-pager {
        display: flex;
        justify-content: center;
        padding: 4px 0 2px;
    }

    .home-cat-pager span {
        width: 18px;
        height: 3px;
        border-radius: 2px;
        background: #f57224;
    }

    .home-promo-top {
        background: transparent;
        padding: 6px 0 4px !important;
    }

    .home-promo-top .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .home-promo-top .promo-banner,
    .home-promo-top .promo-banner-img {
        border-radius: 12px !important;
    }

    /* Flash Sale row like Daraz */
    .flash-sale-section {
        background: #fff;
        margin: 8px 0 0;
        padding: 4px 0 12px;
        border-radius: 12px 12px 0 0;
    }

    .flash-sale-head {
        background: #fff !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 10px 12px 6px !important;
        margin-bottom: 8px !important;
        overflow: visible !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .flash-sale-head::after {
        display: none !important;
    }

    .flash-sale-bolt,
    .flash-sale-heading-text p,
    .flash-sale-timer {
        display: none !important;
    }

    .flash-sale-heading {
        margin-right: 0 !important;
        width: auto !important;
        flex: 1;
    }

    .flash-sale-heading-text h2 {
        font-size: 18px !important;
        font-weight: 700;
        color: #222 !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .fs-va-full {
        display: none !important;
    }

    .fs-va-more {
        display: inline-flex !important;
        align-items: center;
        gap: 4px;
    }

    .flash-sale-viewall {
        background: none !important;
        color: #9b59d0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        font-size: 13px !important;
        font-weight: 600;
        margin-left: auto;
    }

    .flash-sale-viewall i {
        font-size: 11px;
    }

    /* Bottom tab bar */
    .mobile-bottom-nav,
    .app-home .mobile-bottom-nav {
        display: flex;
        background: #fff !important;
        border-top: 1px solid #eee;
        border-radius: 0;
        box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.05);
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        backdrop-filter: none;
    }

    .mobile-bottom-nav a,
    .app-home .mobile-bottom-nav a {
        color: #9a9a9a;
        font-size: 10px;
        font-weight: 500;
        gap: 3px;
    }

    .mobile-bottom-nav a i,
    .app-home .mobile-bottom-nav a i {
        width: auto;
        height: auto;
        background: none !important;
        border-radius: 0;
        font-size: 20px;
        color: inherit;
        box-shadow: none !important;
    }

    .mobile-bottom-nav a.active,
    .app-home .mobile-bottom-nav a.active {
        color: #f57224;
        font-weight: 600;
    }
}
