/* E-shop: design fonts (Aqar360 eShop — matches tailwind.config primary / gradient tokens) */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;500;600&family=DM+Sans:wght@400;500;700&display=swap");

.eshop-root,
.shop-page {
    font-family: "Open Sans", system-ui, sans-serif;
    color: hsl(261, 15%, 18%);
    background-color: hsl(0, 0%, 98%);
    overflow: visible; /* sticky filter bar: do not clip (see .shop-filter-sticky) */
}

.eshop-root h1,
.eshop-root h2,
.eshop-root h3,
.eshop-root .font-heading,
.shop-page h1,
.shop-page h2,
.shop-page h3,
.shop-page .font-heading {
    font-family: "Poppins", system-ui, sans-serif;
}

.eshop-root .font-label-ui,
.shop-page .font-label-ui {
    font-family: "DM Sans", system-ui, sans-serif;
}

/* Hero: always readable (matches site purple #6B5B95) even if Tailwind utilities fail to load */
.eshop-hero-section {
    background: linear-gradient(135deg, #6b5b95 0%, #574a75 55%, #7d6ba8 100%);
    color: #fff;
}

.eshop-hero-section h1,
.eshop-hero-section p,
.eshop-hero-section .font-body {
    color: inherit;
}

.eshop-hero-section .eshop-hero-subtitle {
    color: rgba(255, 255, 255, 0.92);
}

.eshop-hero-section a.bg-white {
    color: #6b5b95 !important;
}

/* Hero delivery location <select>: closed state matches hero; list = white + readable text (native popup varies by OS) */
.eshop-hero-section select.eshop-hero-location-select {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color-scheme: light;
}

.eshop-hero-section select.eshop-hero-location-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.eshop-hero-section select.eshop-hero-location-select option {
    background-color: #fff;
    color: hsl(261, 22%, 20%);
}

.eshop-hero-section select.eshop-hero-location-select option:hover,
.eshop-hero-section select.eshop-hero-location-select option:focus {
    background-color: hsl(263, 42%, 96%);
    color: hsl(261, 28%, 32%);
}

.eshop-hero-section select.eshop-hero-location-select option:checked {
    background-color: hsl(263, 35%, 93%);
    color: #4a3d6f;
    font-weight: 600;
}

.eshop-hero-section select.eshop-hero-location-select option.eshop-hero-location-add-option {
    font-weight: 600;
    color: #6b5b95;
}

/* Sticky filter bar: stays under fixed header while scrolling product list
   (do not set overflow:hidden on .shop-page — it breaks position:sticky) */

.shop-filter-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: var(--client-fixed-header-offset, max(120px, calc(100px + env(safe-area-inset-top, 0px))));
    z-index: 9990;
    background-color: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(107, 91, 149, 0.14);
    box-shadow: 0 4px 18px rgba(39, 32, 66, 0.06);
}

/* Shop catalog: search + filter icon stay on one row on mobile (details is inline-flex below lg) */
.retail-catalog-search-filter-row {
    min-width: 0;
}

/* Shop catalog: keep search + filters + actions on one row; scroll horizontally on narrow viewports */
.retail-shop-filter-row {
    -webkit-overflow-scrolling: touch;
}
.retail-shop-filter-row::-webkit-scrollbar {
    height: 5px;
}
.retail-shop-filter-row::-webkit-scrollbar-thumb {
    background: rgba(107, 91, 149, 0.35);
    border-radius: 9999px;
}
.retail-shop-filter-input,
.retail-shop-filter-select {
    box-sizing: border-box;
}
.retail-shop-filter-select {
    text-overflow: ellipsis;
    line-height: 1.25;
}

/* Filter bar: keep action labels on one line (Arabic “تطبيق الفلتر”, etc.) */
.retail-shop-filter-actions button,
.retail-shop-filter-actions a {
    white-space: nowrap;
}

/* Mobile collapsible filter panel (native <details>) */
.retail-filter-trigger {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(220, 13%, 91%);
    background: #fff;
    color: hsl(261, 15%, 25%);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.retail-filter-trigger::-webkit-details-marker {
    display: none;
}
.retail-filter-trigger::marker {
    content: "";
}
.retail-filter-trigger:hover {
    background: hsl(263, 28%, 96%);
    border-color: rgba(107, 91, 149, 0.35);
    color: #6b5b95;
}
.retail-filter-trigger__dot {
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #6b5b95;
    border: 2px solid #fff;
}
.retail-filter-details[open] .retail-filter-trigger {
    background: #6b5b95;
    color: #fff;
    border-color: #6b5b95;
}

@media (max-width: 1023.98px) {
    /* Sticky filter flush under fixed header (topBar + h-20); avoids scroll bleed in the gap */
    .shop-page .shop-filter-sticky {
        top: var(--client-fixed-header-offset, calc(5rem + 2.25rem + env(safe-area-inset-top, 0px)));
        margin-top: -1px;
    }

    .retail-filter-popover {
        display: none;
    }
    .retail-filter-details[open] .retail-filter-popover {
        display: flex;
        position: absolute;
        inset-inline: 1rem;
        top: calc(100% + 0.25rem);
        background: #fff;
        border: 1px solid rgba(107, 91, 149, 0.18);
        border-radius: 0.75rem;
        box-shadow: 0 18px 40px rgba(39, 32, 66, 0.18);
        padding: 0.75rem;
        z-index: 9991;
    }
}

/* Partners slider: hidden scrollbar, edge mask, fading nav arrows */
.retail-partners-slider {
    position: relative;
}
.retail-partners-track {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 calc(100% - 32px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 32px,
        #000 calc(100% - 32px),
        transparent 100%
    );
}
.retail-partners-track::-webkit-scrollbar {
    display: none;
}

.retail-partners-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    color: #2b2240;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.15s ease;
    border: none;
    cursor: pointer;
}
.retail-partners-nav:hover {
    background: #fff;
}
.retail-partners-slider:hover .retail-partners-nav,
.retail-partners-nav:focus-visible {
    opacity: 1;
}
.retail-partners-nav--prev {
    inset-inline-start: -0.5rem;
}
.retail-partners-nav--next {
    inset-inline-end: -0.5rem;
}
.retail-partners-nav[disabled] {
    opacity: 0.25;
    pointer-events: none;
}

/* Desktop / large screens: center partner chips when the row is short, and place
   nav buttons in the layout flow (no overlap / edge fade). Mobile & tablet below
   lg keep the original overlay + mask behavior. */
@media (min-width: 1024px) {
    .retail-partners-slider {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 1rem;
    }

    .retail-partners-slider .retail-partners-nav {
        position: static;
        transform: none;
        opacity: 1;
        width: 2.5rem;
        height: 2.5rem;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.35);
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
    }

    .retail-partners-slider .retail-partners-nav:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.24);
        color: #fff;
    }

    .retail-partners-slider .retail-partners-nav:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.85);
        outline-offset: 2px;
    }

    .retail-partners-slider .retail-partners-nav[disabled] {
        opacity: 0.35;
    }

    .retail-partners-track {
        -webkit-mask-image: none;
        mask-image: none;
        justify-content: safe center;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .retail-partners-nav {
        display: none;
    }
    .retail-partners-track {
        -webkit-mask-image: none;
        mask-image: none;
    }
}

/* Cart: page background comes from Tailwind gradient on inner wrapper */
.shop-page.eshop-cart-page {
    background-color: transparent;
}

@media (min-width: 1024px) {
    .eshop-cart-summary {
        position: sticky;
        top: calc(var(--client-fixed-header-offset, 120px) + 12px);
        z-index: 20;
        align-self: flex-start;
    }
}

/* Select city page: elevated background + list buttons (also covers JS-injected links) */
.retail-select-city-page .retail-select-city-bg {
    background: linear-gradient(
        165deg,
        hsl(263, 28%, 96%) 0%,
        hsl(0, 0%, 99%) 42%,
        hsl(265, 24%, 93%) 100%
    );
}

.retail-select-city-page .retail-select-city-bg::before {
    content: "";
    position: absolute;
    width: 140%;
    height: 55%;
    top: -18%;
    left: -20%;
    background: radial-gradient(
        ellipse 70% 60% at 50% 40%,
        hsl(263, 35%, 42%, 0.09) 0%,
        transparent 72%
    );
}

.retail-select-city-page .retail-select-city-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(hsl(261, 15%, 18%, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.55;
}

.retail-city-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

a.retail-city-choice {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    background: #6b5b95;
    box-shadow: 0 1px 3px rgba(39, 32, 66, 0.2);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

a.retail-city-choice:hover {
    background: #7d6ba8;
    box-shadow: 0 4px 14px rgba(107, 91, 149, 0.35);
    transform: translateY(-1px);
}

a.retail-city-choice:focus-visible {
    outline: 2px solid #6b5b95;
    outline-offset: 3px;
}

/* --- Shop catalog product cards: stable image frame + readable size ---
   Global rules (e.g. newhome.css `img { height: auto; }`) can fight `h-full` on card
   images and collapse the media area into thin strips. Grid items also need
   `min-width: 0` so columns don’t overflow oddly on narrow tracks. */

.shop-page #product-grid .grid > .group {
    min-width: 0;
}

.shop-page #product-grid .group > a:first-of-type {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 5rem;
    overflow: hidden;
    background-color: hsl(0, 0%, 94%);
}

.shop-page #product-grid .group > a:first-of-type > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.shop-page #product-grid .group > a:first-of-type > div:not(.absolute) {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Return request UI (My Order) --- */

.eshop-return-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    border-width: 1px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.eshop-return-banner__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.eshop-return-banner__text {
    margin: 0;
    font-family: "DM Sans", system-ui, sans-serif;
}

.eshop-return-banner--pending {
    border-color: rgb(251 191 36 / 0.45);
    background: rgb(255 251 235);
    color: rgb(146 64 14);
}

.eshop-return-banner--success {
    border-color: rgb(16 185 129 / 0.35);
    background: rgb(236 253 245);
    color: rgb(6 95 70);
}

.eshop-return-banner--warning {
    border-color: rgb(251 191 36 / 0.4);
    background: rgb(255 251 235);
    color: rgb(120 53 15);
}

.eshop-return-banner--danger {
    border-color: rgb(248 113 113 / 0.45);
    background: rgb(254 242 242);
    color: rgb(153 27 27);
}

/* Return modal — explicit colors (avoids --card: transparent from theme) */
.eshop-return-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    isolation: isolate;
}

@media (max-width: 640px) {
    .eshop-return-modal {
        align-items: flex-end;
        padding: 0;
    }
}

.eshop-return-modal.hidden {
    display: none !important;
}

.eshop-return-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42 / 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.eshop-return-modal--open .eshop-return-modal__backdrop {
    opacity: 1;
}

.eshop-return-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    max-height: min(90vh, 640px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow:
        0 25px 50px -12px rgb(0 0 0 / 0.35),
        0 0 0 1px rgb(255 255 255 / 0.08);
    padding: 0;
    opacity: 0;
    transform: scale(0.96) translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color-scheme: light;
}

@media (max-width: 640px) {
    .eshop-return-modal__panel {
        border-radius: 1.25rem 1.25rem 0 0;
        max-height: 92vh;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
}

.eshop-return-modal--open .eshop-return-modal__panel {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.eshop-return-modal__hero {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.eshop-return-modal__icon-wrap {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgb(254 243 199);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eshop-return-modal__icon {
    width: 1.5rem;
    height: 1.5rem;
    color: rgb(180 83 9);
}

.eshop-return-modal__title-block {
    flex: 1;
    min-width: 0;
    padding-top: 0.125rem;
}

.eshop-return-modal__title {
    margin: 0;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
}

.eshop-return-modal__intro {
    margin: 0.375rem 0 0;
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #475569;
}

.eshop-return-modal__close {
    flex-shrink: 0;
    padding: 0.375rem;
    margin: -0.25rem;
    border: none;
    background: #ffffff;
    border-radius: 0.5rem;
    color: #64748b;
    cursor: pointer;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.eshop-return-modal__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.eshop-return-modal__form {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: #ffffff;
}

.eshop-return-modal__field {
    margin-bottom: 1.25rem;
}

.eshop-return-modal__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.eshop-return-modal__label {
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.eshop-return-modal__counter {
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: #64748b;
}

.eshop-return-modal__counter--warn {
    color: rgb(180 83 9);
    font-weight: 600;
}

.eshop-return-modal__counter--ok {
    color: rgb(5 150 105);
}

.eshop-return-modal__textarea {
    display: block;
    width: 100%;
    min-height: 7.5rem;
    padding: 0.75rem 1rem;
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.eshop-return-modal__textarea::placeholder {
    color: #94a3b8;
}

.eshop-return-modal__textarea:focus {
    border-color: #6b5b95;
    box-shadow: 0 0 0 3px rgb(107 91 149 / 0.2);
}

.eshop-return-modal__textarea:invalid:not(:placeholder-shown) {
    border-color: rgb(248 113 113);
}

.eshop-return-modal__hint {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
}

.eshop-return-modal__footer {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid #e2e8f0;
}

[dir="rtl"] .eshop-return-modal__footer {
    flex-direction: row-reverse;
}

.eshop-return-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.875rem;
    padding: 0.625rem 1rem;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.eshop-return-modal__btn--secondary {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.eshop-return-modal__btn--secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.eshop-return-modal__btn--primary {
    background: linear-gradient(180deg, #7568a8 0%, #6b5b95 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgb(107 91 149 / 0.35);
}

.eshop-return-modal__btn--primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #6b5b95 0%, #574a75 100%);
    box-shadow: 0 4px 12px rgb(107 91 149 / 0.4);
}

.eshop-return-modal__btn--primary:disabled,
.eshop-return-modal__btn--loading {
    opacity: 0.65;
    cursor: not-allowed;
}

.eshop-return-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1.25rem;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #6b5b95;
    background: rgb(107 91 149 / 0.08);
    border: 2px solid rgb(107 91 149 / 0.22);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.eshop-return-open-btn:hover {
    background: rgb(107 91 149 / 0.14);
    border-color: rgb(107 91 149 / 0.38);
}

.eshop-return-open-btn__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
