/*
 * public.css
 * ملف تنسيق صفحة اختيار المتاجر والمعرض العام.
 *
 * ملاحظات التنظيم:
 * - ألوان كل هوية موجودة في متغيرات body[data-mode].
 * - لا توجد تعريفات مكررة للعناصر القديمة.
 * - شبكة المتاجر والأقسام تبقى بعمودين على الجوال.
 * - تأثيرات hover تعمل على أجهزة الماوس فقط.
 */

:root {
    --font-ui: 'Tajawal', sans-serif;
    --athnta-gold: #d4aa6d;
    --athnta-gold-light: #e6c58f;
    --lavinta-cream: #f1dfd2;
    --lavinta-brown: #5e4a3f;
    --white: #fff;
    --black: #050505;
}

/* =========================
   الأساسيات
   ========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--black);
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;

    background: var(--page-background, var(--black));
    color: var(--text-main, #f4f4f4);
    font-family: var(--font-ui);
    line-height: 1.6;

    transition:
        background 0.45s ease,
        color 0.35s ease;
}

body,
button,
input,
select,
textarea {
    font-family: var(--font-ui);
}

button,
a,
img {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent, var(--athnta-gold));
    color: var(--selection-text, #211915);
}

[hidden] {
    display: none !important;
}

/* يمنع بقاء العناصر القديمة إذا كانت موجودة في نسخة HTML السابقة */
#subHeaderText,
.profile-subtitle,
.back-to-gateway-btn,
.mode-tabs {
    display: none !important;
}

/* =========================
   هويات الموقع
   ========================= */

body[data-mode="gateway"] {
    --page-background:
        radial-gradient(circle at 12% 18%, rgba(212, 170, 109, 0.2), transparent 31%),
        radial-gradient(circle at 88% 82%, rgba(94, 74, 63, 0.52), transparent 38%),
        linear-gradient(115deg, #050505 0%, #15110f 44%, #5e4a3f 100%);
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.18);
    --text-main: #fffaf5;
    --text-muted: #d8c9c0;
    --heading: #fff8ef;
    --accent: var(--athnta-gold);
    --accent-soft: rgba(212, 170, 109, 0.15);
    --nav-background: rgba(21, 17, 15, 0.9);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    --selection-text: #211915;
}

body[data-mode="embroidery"] {
    --page-background: #050505;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.12);
    --text-main: #f4f4f4;
    --text-muted: #a0a0a0;
    --heading: #fcf9f2;
    --accent: var(--athnta-gold);
    --accent-soft: rgba(212, 170, 109, 0.12);
    --nav-background: rgba(5, 5, 5, 0.9);
    --shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
    --selection-text: #211915;
}

body[data-mode="printing"] {
    --page-background:
        radial-gradient(circle at 15% 20%, rgba(255, 248, 240, 0.11), transparent 34%),
        linear-gradient(135deg, #5e4a3f 0%, #45342d 100%);
    --surface: rgba(255, 248, 240, 0.08);
    --surface-strong: rgba(255, 248, 240, 0.14);
    --border: rgba(255, 248, 240, 0.26);
    --text-main: #f8f1e9;
    --text-muted: #d8c9ba;
    --heading: #fff8f0;
    --accent: var(--lavinta-cream);
    --accent-soft: rgba(241, 223, 210, 0.12);
    --nav-background: rgba(94, 74, 63, 0.92);
    --shadow: 0 14px 38px rgba(35, 24, 19, 0.3);
    --selection-text: var(--lavinta-brown);
}

html,
body {
    background-color: var(--black);
}

body[data-mode="gateway"],
body[data-mode="embroidery"],
body[data-mode="printing"] {
    background: var(--page-background);
    background-attachment: scroll;
}

/* =========================
   التخطيط العام
   ========================= */

.container {
    width: min(1200px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(18px, 4vw, 42px) 0 60px;
}

/* =========================
   صفحة اختيار المتجر
   ========================= */

.store-gateway {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: calc(100vh - 100px);
    padding: clamp(24px, 6vw, 72px) 0;
}

.gateway-inner {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
    animation: gateway-enter 0.7s ease both;
}

.gateway-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 18px;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--athnta-gold-light);
    direction: ltr;
    font-size: 0.84rem;
    letter-spacing: 0.2em;
}

.gateway-description {
    max-width: 670px;
    margin: 22px auto 38px;
    color: var(--text-muted);
    font-size: clamp(1rem, 2.1vw, 1.22rem);
    line-height: 2;
}

.gateway-description:empty {
    display: none;
}

/* الشعارات والروابط بجانب بعض دائمًا */
.store-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    width: 100%;
    max-width: 820px;
    margin: 34px auto 0;
    gap: clamp(12px, 7vw, 92px);
}

.store-choice {
    --choice-accent: var(--athnta-gold);

    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
    gap: 12px;
    padding: 12px 8px;

    border: 0;
    border-radius: 18px;
    outline: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-main);
    font: inherit;
    text-align: center;
    cursor: pointer;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.store-choice--printing {
    --choice-accent: var(--lavinta-cream);
}

.store-choice-logo-wrap {
    display: grid;
    place-items: center;
    width: min(100%, 200px);
    height: clamp(84px, 12vw, 124px);
}

.store-choice-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}

.store-choice-title {
    max-width: 270px;
    color: #fffaf5;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    font-weight: 700;
    line-height: 1.55;
}

.store-choice-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding-bottom: 4px;
    border-bottom: 1px solid currentColor;
    color: var(--choice-accent);
    font-size: clamp(0.76rem, 1.5vw, 0.98rem);
    line-height: 1.5;

    transition:
        color 0.25s ease,
        gap 0.25s ease;
}

.store-choice:focus-visible {
    outline: 2px solid var(--choice-accent);
    outline-offset: 6px;
}

@media (hover: hover) and (pointer: fine) {
    .store-choice:hover {
        background: rgba(255, 255, 255, 0.035);
        transform: translateY(-4px);
    }

    .store-choice:hover .store-choice-logo {
        transform: translateY(-6px) scale(1.03);
        filter: drop-shadow(0 17px 28px rgba(0, 0, 0, 0.34));
    }

    .store-choice:hover .store-choice-action {
        gap: 14px;
    }
}

/* =========================
   رأس المتجر
   ========================= */

.store-app {
    width: 100%;
}

.profile-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: clamp(26px, 5vw, 50px);
    text-align: center;
    /* A transformed ancestor traps fixed navigation inside the header. */
    min-height: 186px;
}

.nav-box {
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    transition:
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.store-back-btn {
    position: absolute;
    top: 50%;
    right: clamp(10px, 4%, 56px);
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    transform: translateY(-50%);

    border: 1px solid var(--accent);
    border-color: color-mix(in srgb, var(--accent) 65%, transparent);
    border-radius: 50%;
    background: var(--accent-soft);
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-main);
    cursor: pointer;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.store-back-btn svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.store-back-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.nav-whatsapp {
    position: absolute;
    top: 50%;
    left: clamp(10px, 4%, 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);

    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-main);
    opacity: 0;
    visibility: hidden;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.nav-whatsapp svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.nav-box.sticky {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    width: 100%;
    height: 72px;
    min-height: 72px;

    border-bottom: 1px solid var(--border);
    background: var(--nav-background);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-box.sticky .nav-whatsapp {
    opacity: 1;
    visibility: visible;
}

/* الشعاران يستخدمان نفس المساحة حتى لا يتغير شكل الرأس عند التبديل */
.store-app .profile-logo {
    display: block;
    width: min(82vw, 230px);
    height: 110px;
    margin: 18px auto 10px;
    padding: 0;
    object-fit: contain;
    cursor: pointer;
    transition:
        filter 0.35s ease,
        opacity 0.25s ease;
}

/* الشعار يبقى في المنتصف عندما يتحول الشريط إلى شريط ثابت */
.nav-box.sticky + .profile-logo {
    position: fixed;
    top: 7px;
    left: 50%;
    z-index: 1001;
    width: 118px;
    height: 58px;
    margin: 0;
    transform: translateX(-50%);
}

/* =========================
   عناوين وأقسام المعرض
   ========================= */

.section-title {
    display: block;
    width: 100%;
    margin: 0 0 clamp(20px, 4vw, 30px);
    padding: 0 0 15px;

    border-bottom: 1px solid var(--border);
    color: var(--heading);
    font-size: clamp(1.18rem, 3vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.55;
    text-align: center;
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.18);
}

#products-section,
#reviews-section {
    display: none;
    padding-top: 4px;
    animation: fade-in 0.45s ease both;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    gap: clamp(10px, 2.2vw, 20px);
}

.glass-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.cat-card {
    min-width: 0;
    aspect-ratio: 9 / 14;
    cursor: pointer;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.cat-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.cat-card .image-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cat-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.cat-card::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: '';
    background: rgba(0, 0, 0, 0.48);
    transition: background-color 0.35s ease;
}

.cat-card h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 90%;
    margin: 0;
    color: #fff;
    font-size: clamp(0.95rem, 2.5vw, 1.4rem);
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%);
    transition: transform 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .store-back-btn:hover {
        background: var(--accent);
        color: var(--selection-text);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
        transform: translateY(-50%) scale(1.08);
    }

    .nav-whatsapp:hover {
        background: var(--accent);
        color: var(--selection-text);
    }

    .cat-card:hover {
        border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
        transform: translateY(-6px);
    }

    .cat-card:hover::before {
        background: rgba(0, 0, 0, 0.64);
    }

    .cat-card:hover img {
        transform: scale(1.07);
    }

    .cat-card:hover h3 {
        transform: translate(-50%, calc(-50% + 8px));
    }
}

/* =========================
   صفحة المنتجات
   ========================= */

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

#category-title,
.products-header h2 {
    min-width: 0;
    margin: 0;
    color: var(--heading);
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.btn-back,
.filter-btn,
.reviews-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.btn-back {
    flex: 0 0 auto;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.94rem;
    white-space: nowrap;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 26px;
}

.filter-btn {
    padding: 8px 18px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.filter-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--selection-text);
}

.more-filters-container {
    position: relative;
    display: inline-flex;
}

.more-filters-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: none;
    flex-direction: column;
    min-width: 155px;
    max-height: min(320px, 50vh);
    padding: 8px;
    overflow-y: auto;
    gap: 6px;

    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(15, 15, 15, 0.96);
    background: var(--dialog-background, #151515);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.more-filters-dropdown.show {
    display: flex;
    animation: fade-in 0.2s ease both;
}

.dropdown-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    text-align: center;
}

.dropdown-item:hover {
    transform: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: clamp(10px, 1.8vw, 18px);
}

.product-card {
    min-width: 0;
    padding-bottom: 14px;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

.product-card .image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.product-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.product-card h4 {
    width: 90%;
    margin: 12px auto 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: clamp(0.8rem, 1.7vw, 1rem);
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-img-icon {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    backdrop-filter: blur(5px);
}

.multi-img-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.hover-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hover-overlay span {
    padding: 8px 14px;
    border: 1px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.3;
    backdrop-filter: blur(4px);
}

@media (hover: hover) and (pointer: fine) {
    .btn-back:hover,
    .filter-btn:hover,
    .reviews-btn:hover {
        border-color: var(--accent);
        background: var(--accent);
        color: var(--selection-text);
        transform: translateY(-2px);
    }

    .product-card:hover {
        border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
        transform: translateY(-4px);
    }

    .product-card .image-container:hover .hover-overlay {
        opacity: 1;
    }

    .product-card .image-container:hover img {
        transform: scale(1.05);
    }
}

/* =========================
   الآراء والتذييل
   ========================= */

.reviews-btn-wrapper {
    margin: 42px 0 20px;
    text-align: center;
}

.reviews-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 30px;
    border-radius: 999px;
    font-size: 1.05rem;
}

.reviews-masonry {
    column-count: 3;
    column-gap: 22px;
    padding: 12px 8px;
}

/* Uneven photo collage; preserve each screenshot's full aspect ratio. */
.reviews-masonry .review-img-wrap {
    width: 94%;
    display: inline-block;
    vertical-align: top;
    transform: rotate(-1.5deg);
    margin: 8px 2% 22px;
}
.reviews-masonry .review-img-wrap { aspect-ratio: 1 / 1; }
.reviews-masonry .review-img-wrap:nth-of-type(4n + 2) {
    width: 84%;
    aspect-ratio: 3 / 4;
    margin-inline-start: 10%;
    transform: rotate(2deg);
}
.reviews-masonry .review-img-wrap:nth-of-type(4n + 3) {
    width: 98%;
    aspect-ratio: 4 / 3;
    margin-inline-start: 0;
    transform: rotate(1deg);
}
.reviews-masonry .review-img-wrap:nth-of-type(4n) {
    width: 89%;
    aspect-ratio: 4 / 5;
    transform: rotate(-2deg);
}
.reviews-masonry .review-img-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
}
.reviews-masonry > .btn-back, .reviews-masonry > .empty-state {
    column-span: all;
    display: block;
    margin: 20px auto;
}
@media (max-width: 700px) {
    .reviews-masonry { column-count: 2; column-gap: 10px; }
}

.review-img-wrap {
    position: relative;
    break-inside: avoid;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: zoom-in;
}

.review-img-wrap img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    transition: transform 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .review-img-wrap:hover img {
        transform: scale(1.03);
    }
}

.social-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-main);
    text-decoration: none;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.social-btn svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

@media (hover: hover) and (pointer: fine) {
    .social-btn:hover {
        background: var(--accent);
        color: var(--selection-text);
        transform: translateY(-4px);
    }
}

.empty-state {
    grid-column: 1 / -1;
    margin: 0;
    padding: 42px 15px;
    color: var(--text-muted);
    font-size: 1.05rem;
    text-align: center;
}

/* =========================
   النوافذ المنبثقة
   ========================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    animation: fade-in 0.25s ease both;
}

.modal-content {
    position: relative;
    width: min(100%, 450px);
    max-height: min(92vh, 760px);
    padding: 20px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(15, 15, 15, 0.96);
    background: var(--dialog-background, #151515);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.65);
}

.close-modal {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.close-modal:hover {
    background: #d94b4b;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modalSwiper {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.modalSwiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modalSwiper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-title {
    margin: 5px 0 0;
    color: var(--heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

.modal-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 5px;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.28);
    transition:
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.modal-whatsapp-btn svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
}

.modal-whatsapp-btn:hover {
    box-shadow: 0 7px 22px rgba(37, 211, 102, 0.45);
    transform: translateY(-2px);
}

.swiper-button-next,
.swiper-button-prev {
    width: 35px !important;
    height: 35px !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.48);
    color: #fff !important;
    backdrop-filter: blur(4px);
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 16px !important;
    font-weight: 700;
}

.swiper-pagination-bullet {
    background: #fff !important;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}

#reviewImgModal {
    cursor: zoom-out;
}

#expandedReviewImg {
    display: block;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    object-fit: contain;
}

/* =========================
   هوية الطباعة LAVINTA
   ========================= */

body[data-mode="printing"] .store-back-btn {
    border-color: rgba(241, 223, 210, 0.6);
}

body[data-mode="printing"] .nav-box.sticky {
    border-bottom-color: rgba(255, 248, 240, 0.22);
    box-shadow: 0 10px 30px rgba(35, 24, 19, 0.42);
}

body[data-mode="printing"] .glass-card {
    background: rgba(43, 30, 24, 0.2);
    border-color: rgba(255, 248, 240, 0.25);
}

body[data-mode="printing"] .cat-card::before {
    background: rgba(48, 34, 27, 0.38);
}

body[data-mode="printing"] .hover-overlay {
    background: rgba(55, 40, 33, 0.5);
}

body[data-mode="printing"] .modal {
    background: rgba(35, 25, 21, 0.84);
}

body[data-mode="printing"] {
    --dialog-background: #48352c;
}

body[data-mode="printing"] .modalSwiper {
    background: #3d2d26;
}

/* =========================
   الاستجابة للشاشات الصغيرة
   ========================= */

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

@media (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .reviews-masonry {
        column-count: 3;
    }
}

@media (min-width: 1150px) {
    .reviews-masonry {
        column-count: 4;
    }
}

@media (max-width: 700px) {
    .container {
        width: calc(100% - 20px);
        padding-top: 14px;
        padding-bottom: 36px;
    }

    .store-gateway {
        min-height: calc(100vh - 60px);
        padding: 28px 0 20px;
    }

    .gateway-description {
        margin: 18px auto 26px;
        line-height: 1.8;
    }

    .store-choices {
        gap: 8px;
        margin-top: 24px;
    }

    .store-choice {
        gap: 10px;
        padding: 8px 2px;
    }

    .store-choice-logo-wrap {
        height: 88px;
    }

    .store-choice-title {
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .store-choice-action {
        gap: 5px;
        padding-bottom: 3px;
        font-size: 0.64rem;
        white-space: nowrap;
    }

    .profile-header {
        margin-bottom: 26px;
        min-height: 168px;
    }

    .store-app .profile-logo {
        width: min(78vw, 210px);
        height: 96px;
        margin-top: 14px;
    }

    .nav-box.sticky {
        height: 64px;
        min-height: 64px;
    }

    .nav-box.sticky + .profile-logo {
        top: 5px;
        width: 106px;
        height: 54px;
    }

    .store-back-btn,
    .nav-whatsapp {
        width: 39px;
        height: 39px;
    }

    .store-back-btn {
        right: 10px;
    }

    .nav-whatsapp {
        left: 10px;
    }

    .section-title {
        margin-bottom: 20px;
        padding-bottom: 12px;
        font-size: 1.2rem;
    }

    .categories-grid {
        gap: 9px;
    }

    .cat-card {
        border-radius: 15px;
    }

    .cat-card h3 {
        font-size: 0.92rem;
    }

    .products-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }

    #category-title,
    .products-header h2 {
        font-size: 1.25rem;
        text-align: center;
    }

    .btn-back {
        width: 100%;
    }

    .filters {
        gap: 7px;
        margin-bottom: 20px;
    }

    .filter-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .product-card {
        border-radius: 14px;
    }

    .product-card h4 {
        margin-top: 9px;
        font-size: 0.78rem;
    }

    .reviews-btn-wrapper {
        margin-top: 30px;
    }

    .reviews-btn {
        width: min(100%, 260px);
        padding: 11px 18px;
        font-size: 0.95rem;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }

    .modal {
        align-items: flex-start;
        padding-top: max(14px, env(safe-area-inset-top));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .modal-content {
        margin: auto 0;
        padding: 16px;
        border-radius: 17px;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .modal-whatsapp-btn {
        font-size: 0.94rem;
    }

    .social-footer {
        margin-top: 24px;
        padding-top: 22px;
    }
}

@media (max-width: 340px) {
    .container {
        width: calc(100% - 14px);
    }

    .gateway-kicker {
        padding-inline: 12px;
        font-size: 0.72rem;
    }

    .store-choice-logo-wrap {
        height: 76px;
    }

    .store-choice-title {
        font-size: 0.7rem;
    }

    .store-choice-action {
        font-size: 0.58rem;
    }

    .categories-grid {
        gap: 6px;
    }

    .cat-card h3 {
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gateway-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG arrows do not depend on the Swiper icon font. */
.swiper-button-next::after, .swiper-button-prev::after { content: none !important; }
.swiper-button-next, .swiper-button-prev { padding: 7px; border: 0; cursor: pointer; }
.swiper-button-next svg, .swiper-button-prev svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.swiper-rtl .swiper-button-next svg, .swiper-rtl .swiper-button-prev svg { transform: rotate(180deg); }
/* التصنيفات: اثنان في كل صف */
.categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* إذا العدد فردي، آخر تصنيف يأخذ عرض الصف كامل */
.categories-grid > .cat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}
