/* ============================================================
   city-highlights.css — هايلايتس المدن (شكل B: مربعات منحنية)
   الشريط بين عنوان «إيش تدور اليوم» وأزرار الأنواع، والستوري فوق الصفحة كاملة.
   ============================================================ */

/* داخل .index-seg-wrap بين العنوان وأزرار الأنواع، فيأخذ هوامش الحاوية */
#city-highlights {
    --chl-brand: #AD1F24;
    --chl-brand2: #E0A53B;
    --chl-card: #fff;
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 14px;
}
#city-highlights * { box-sizing: border-box; }
html.dark #city-highlights { --chl-card: #0C0F14; }

/* تقليص المساحة الفارغة قبل عنوان «إيش تدور اليوم» */
#products-section .index-seg-wrap { padding-top: 20px; }
@media (min-width: 640px)  { #products-section .index-seg-wrap { padding-top: 26px; } }
@media (min-width: 1024px) { #products-section .index-seg-wrap { padding-top: 30px; } }

/* ---------- الشريط ---------- */
.chl-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.chl-strip::-webkit-scrollbar { display: none; }

.chl-item {
    flex: none;
    width: 88px;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    scroll-snap-align: start;
}

.chl-box {
    position: relative;
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 26px;
    overflow: hidden;
    padding: 3px;
    background: linear-gradient(145deg, var(--chl-brand), var(--chl-brand2));
    transition: transform .18s ease;
}
.chl-item:active .chl-box { transform: scale(.95); }
.chl-item:focus { outline: none; }
.chl-item:focus-visible .chl-box { box-shadow: 0 0 0 3px rgba(173, 31, 36, .45); }
@media (hover: hover) {
    .chl-item:hover .chl-box { transform: translateY(-2px); }
}
.chl-box::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 23px;
    box-shadow: 0 0 0 2px var(--chl-card) inset;
    pointer-events: none;
}
.chl-box img {
    width: 100%;
    height: 100%;
    border-radius: 23px;
    object-fit: cover;
    display: block;
}
.chl-name {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 1;
    padding: 16px 5px 5px;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    background: linear-gradient(to top, rgba(0, 0, 0, .74), rgba(0, 0, 0, 0));
}

/* ---------- الستوري ---------- */
.chl-ov {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    background: rgba(8, 9, 12, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.chl-ov.on { display: grid; }
.chl-ov * { box-sizing: border-box; }
body.chl-lock { overflow: hidden; }

.chl-card {
    position: relative;
    width: 420px;
    max-width: 100vw;
    height: min(740px, 90vh);
    border-radius: 26px;
    overflow: hidden;
    background: #0c0e12;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}
.chl-ov.on .chl-card { animation: chlIn .22s ease both; }
@keyframes chlIn {
    from { transform: scale(.96); opacity: .6; }
    to   { transform: scale(1);   opacity: 1; }
}
@media (max-width: 520px) {
    .chl-card { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
}

.chl-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.chl-stage:focus { outline: none; }
.chl-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .25s ease;
}
.chl-bg.on { opacity: 1; }
.chl-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, .05) 52%, rgba(0, 0, 0, .42));
}

/* شريط التقدّم */
.chl-bars {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    inset-inline: 12px;
    display: flex;
    gap: 4px;
    z-index: 4;
}
.chl-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
}
.chl-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}
.chl-bar.done i { width: 100%; }
.chl-bar.on i { animation: chlFill var(--chl-dur, 5s) linear forwards; }
.chl-ov.paused .chl-bar.on i { animation-play-state: paused; }
@keyframes chlFill {
    from { width: 0; }
    to   { width: 100%; }
}

/* رأس الستوري */
.chl-top {
    position: absolute;
    top: calc(22px + env(safe-area-inset-top, 0px));
    inset-inline: 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    z-index: 4;
    color: #fff;
}
.chl-av {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex: none;
    border: 1.5px solid rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .15);
}
.chl-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chl-top-t { min-width: 0; }
.chl-top-t b {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chl-top-t small { display: block; font-size: 10.5px; opacity: .75; margin-top: 1px; }
.chl-x {
    margin-inline-start: auto;
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.chl-x:hover { background: rgba(255, 255, 255, .26); }

/* شريحة الغلاف */
.chl-cover {
    position: absolute;
    inset-inline: 18px;
    bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    color: #fff;
}
.chl-kicker {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    background: rgba(173, 31, 36, .88);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 9px;
}
.chl-cover h3 {
    margin: 0;
    font-size: 27px;
    font-weight: 900;
    line-height: 1.2;
}
.chl-cover p {
    margin: 7px 0 0;
    font-size: 12.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .85);
    max-width: 300px;
}
.chl-tap {
    position: absolute;
    inset-inline: 0;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    text-align: center;
    font-size: 10.5px;
    color: rgba(255, 255, 255, .6);
    animation: chlTap 1.8s ease-in-out infinite;
}
@keyframes chlTap {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}

/* شريحة المزود */
.chl-vbox {
    position: absolute;
    inset-inline: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 3;
    color: #fff;
    display: none;
}
.chl-card.is-vendor .chl-vbox { display: block; }
.chl-card.is-vendor .chl-cover,
.chl-card.is-vendor .chl-tap { display: none; }

.chl-vtype {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    color: #1C1917;
    background: rgba(224, 165, 59, .92);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.chl-vbox h3 {
    margin: 0;
    font-size: 23px;
    font-weight: 900;
    line-height: 1.25;
}
.chl-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    background: #AD1F24;
    color: #fff;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 800;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background .15s ease;
}
.chl-cta:hover { background: #8F171B; }
.chl-cta-a { font-size: 15px; line-height: 1; }

/* أسهم التنقّل: يسار الشاشة ‹ ويمينها › دائماً */
.chl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: none;
    place-items: center;
    direction: ltr; /* حتى لا ينعكس شكل ‹ › في RTL */
}
@media (min-width: 640px) { .chl-nav { display: grid; } }
.chl-nav:hover { background: rgba(255, 255, 255, .3); }
.chl-nav-l { left: 10px; }
.chl-nav-r { right: 10px; }

.chl-x:focus,
.chl-nav:focus,
.chl-cta:focus { outline: none; }
.chl-x:focus-visible,
.chl-nav:focus-visible,
.chl-cta:focus-visible { outline: 2px solid #E0A53B; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .chl-ov.on .chl-card { animation: none; }
    .chl-bg { transition: none; }
    .chl-tap { animation: none; }
}
