/* ==========================================================================
   Storefront v2 — design system
   RTL-first: spacing uses logical properties so the same rules work in LTR.
   ========================================================================== */

:root {
    --sf-brand: #ffdd04;
    --sf-brand-strong: #f2c900;
    --sf-brand-soft: #fff8cc;
    --sf-ink: #141414;
    --sf-ink-2: #3d3d3d;
    --sf-muted: #737373;
    --sf-line: #ececec;
    --sf-surface: #f7f7f5;
    --sf-bg: #ffffff;
    --sf-danger: #d93636;
    --sf-success: #1f9d55;
    --sf-radius: 14px;
    --sf-radius-sm: 10px;
    --sf-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --sf-shadow-lg: 0 20px 50px rgba(0, 0, 0, .18);
    --sf-header-h: 72px;
    --sf-bottombar-h: 64px;
    --sf-font: "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.sf {
    margin: 0;
    font-family: var(--sf-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--sf-ink);
    background: var(--sf-bg);
    -webkit-font-smoothing: antialiased;
}

body.sf a { text-decoration: none; }
:where(body.sf) a { color: inherit; }
body.sf img { max-width: 100%; display: block; }
body.sf button { font-family: inherit; cursor: pointer; }
body.sf input, body.sf select, body.sf textarea { font-family: inherit; font-size: 15px; }

[hidden] { display: none !important; }

.sf-container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 16px; }

.sf-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

body.sf-lock { overflow: hidden; }

/* ---------- Buttons ---------- */
.sf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px;
    border: 1px solid transparent; border-radius: 999px;
    font-weight: 700; font-size: 15px; line-height: 1;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
    white-space: nowrap;
}
.sf-btn:active { transform: scale(.98); }
.sf-btn[disabled] { opacity: .5; cursor: not-allowed; }
.sf-btn--primary { background: var(--sf-brand); color: var(--sf-ink); }
.sf-btn--primary:hover { background: var(--sf-brand-strong); }
.sf-btn--dark { background: var(--sf-ink); color: #fff; }
.sf-btn--dark:hover { background: #000; }
.sf-btn--ghost { background: transparent; border-color: var(--sf-line); color: var(--sf-ink); }
.sf-btn--ghost:hover { border-color: var(--sf-ink); }
.sf-btn--block { width: 100%; }
.sf-btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.sf-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.sf-btn.is-loading::after {
    content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--sf-ink); border-inline-end-color: transparent;
    animation: sf-spin .7s linear infinite;
}
.sf-btn--dark.is-loading::after { border-color: #fff; border-inline-end-color: transparent; }
@keyframes sf-spin { to { transform: rotate(360deg); } }

.sf-icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: transparent; color: var(--sf-ink); font-size: 20px;
    transition: background .15s;
}
.sf-icon-btn:hover { background: var(--sf-surface); }

.sf-badge-count {
    position: absolute; inset-block-start: 4px; inset-inline-end: 2px;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--sf-brand); color: var(--sf-ink);
    font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ---------- Header ---------- */
.sf-header { position: sticky; inset-block-start: 0; z-index: 40; background: #fff; }
.sf-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .06); }

.sf-topbar { background: var(--sf-ink); color: #fff; font-size: 13px; }
.sf-topbar .sf-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; }
.sf-topbar a { opacity: .85; }
.sf-topbar a:hover { opacity: 1; }
.sf-topbar__links { display: flex; gap: 18px; }

.sf-header__main { display: flex; align-items: center; gap: 20px; min-height: var(--sf-header-h); }
.sf-header__logo img { height: 52px; width: auto; }
.sf-header__actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.sf-header__account { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.sf-header__account:hover { background: var(--sf-surface); }
.sf-header__account i { font-size: 18px; }

/* Search */
.sf-search { position: relative; flex: 1; max-width: 620px; }
.sf-search__field {
    display: flex; align-items: center; height: 48px;
    background: var(--sf-surface); border: 1.5px solid transparent; border-radius: 999px;
    transition: border-color .15s, background .15s;
}
.sf-search__field:focus-within { background: #fff; border-color: var(--sf-ink); }
.sf-search__field i { padding-inline: 18px 6px; color: var(--sf-muted); }
.sf-search__field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; color: var(--sf-ink); }
.sf-search__field button { height: 38px; margin-inline-end: 5px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--sf-brand); font-weight: 700; }
.sf-search__panel {
    position: absolute; inset-inline: 0; inset-block-start: calc(100% + 8px);
    background: #fff; border-radius: var(--sf-radius); box-shadow: var(--sf-shadow-lg);
    padding: 10px; max-height: 70vh; overflow: auto; z-index: 60;
}
.sf-search__label { padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--sf-muted); }
.sf-search__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 10px 10px; }
.sf-chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--sf-surface); font-size: 13px; font-weight: 500; }
.sf-chip:hover { background: var(--sf-brand-soft); }
.sf-search__item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--sf-radius-sm); }
.sf-search__item:hover, .sf-search__item.is-active { background: var(--sf-surface); }
.sf-search__item img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--sf-surface); }
.sf-search__item-name { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-search__item-name mark { background: var(--sf-brand-soft); color: inherit; }
.sf-search__item-price { font-size: 13px; font-weight: 700; margin-top: 2px; }
.sf-search__more { display: block; text-align: center; padding: 10px; font-weight: 700; font-size: 14px; border-top: 1px solid var(--sf-line); margin-top: 6px; }
.sf-search__empty { padding: 18px; text-align: center; color: var(--sf-muted); font-size: 14px; }

/* Desktop nav */
.sf-nav { border-block: 1px solid var(--sf-line); }
.sf-nav__list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; min-height: 50px; }
.sf-nav__link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--sf-ink-2); }
.sf-nav__link:hover { background: var(--sf-surface); color: var(--sf-ink); }
.sf-nav__link.is-active { color: var(--sf-ink); font-weight: 700; background: var(--sf-brand-soft); }
.sf-nav__cats-btn { border: 0; background: var(--sf-ink); color: #fff; font-weight: 700; }
.sf-nav__cats-btn:hover { background: #000; color: #fff; }
.sf-nav__item { position: relative; }

.sf-mega.dropdown-menu {
    width: min(880px, calc(100vw - 32px)); padding: 20px; margin-top: 6px !important;
    border: 0; border-radius: var(--sf-radius); box-shadow: var(--sf-shadow-lg);
    grid-template-columns: repeat(4, 1fr); gap: 6px 18px;
}
.sf-mega.dropdown-menu.show { display: grid; }
.sf-mega__group-title { display: flex; align-items: center; gap: 10px; padding: 8px 6px; font-weight: 700; border-radius: 8px; }
.sf-mega__group-title:hover { background: var(--sf-surface); }
.sf-mega__group-title img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--sf-surface); }
.sf-mega__sub { list-style: none; margin: 0 0 8px; padding: 0 48px 0 0; }
[dir="ltr"] .sf-mega__sub { padding: 0 0 0 48px; }
.sf-mega__sub a { display: block; padding: 3px 0; font-size: 14px; color: var(--sf-muted); }
.sf-mega__sub a:hover { color: var(--sf-ink); }

/* Mobile header */
.sf-mobile-only { display: none !important; }
.sf-header__mobile-search { display: none; padding: 0 16px 12px; }

@media (max-width: 991.98px) {
    :root { --sf-header-h: 60px; }
    .sf-desktop-only { display: none !important; }
    .sf-mobile-only { display: inline-flex !important; }
    .sf-topbar { display: none; }
    .sf-nav { display: none; }
    .sf-header__main { gap: 6px; }
    .sf-header__logo { position: absolute; inset-inline-start: 50%; transform: translateX(50%); }
    [dir="ltr"] .sf-header__logo { transform: translateX(-50%); }
    .sf-header__logo img { height: 42px; }
    .sf-header__main > .sf-search { display: none; }
    .sf-header__mobile-search { display: block; }
    .sf-search__field { height: 44px; }
    .sf-search__panel { position: fixed; inset-inline: 12px; inset-block-start: 116px; max-height: calc(100vh - 200px); }
    .sf-header { transition: transform .25s; }
}

/* ---------- Mobile bottom bar ---------- */
.sf-bottombar {
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 45;
    display: none; height: calc(var(--sf-bottombar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--sf-line);
}
.sf-bottombar__list { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--sf-bottombar-h); margin: 0; padding: 0; list-style: none; }
.sf-bottombar__item { display: flex; }
.sf-bottombar__link {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; color: var(--sf-muted); font-size: 11px; font-weight: 500;
}
.sf-bottombar__link i { font-size: 20px; }
.sf-bottombar__link.is-active { color: var(--sf-ink); font-weight: 700; }
.sf-bottombar__link.is-active::before {
    content: ""; position: absolute; inset-block-start: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--sf-brand-strong);
}
.sf-bottombar__icon { position: relative; display: inline-flex; }
.sf-bottombar__icon .sf-badge-count { inset-block-start: -6px; inset-inline-end: -12px; }

@media (max-width: 991.98px) {
    .sf-bottombar { display: block; }
    body.sf { padding-bottom: calc(var(--sf-bottombar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Drawers ---------- */
.sf-overlay {
    position: fixed; inset: 0; z-index: 70; background: rgba(15, 15, 15, .45);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.sf-overlay.is-open { opacity: 1; visibility: visible; }
.sf-drawer {
    position: fixed; inset-block: 0; z-index: 80; width: min(400px, 90vw);
    display: flex; flex-direction: column; background: #fff; box-shadow: var(--sf-shadow-lg);
    visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s;
}
.sf-drawer--start { inset-inline-start: 0; transform: translateX(100%); }
.sf-drawer--end { inset-inline-end: 0; transform: translateX(-100%); }
[dir="ltr"] .sf-drawer--start { transform: translateX(-100%); }
[dir="ltr"] .sf-drawer--end { transform: translateX(100%); }
.sf-drawer.is-open { transform: none; visibility: visible; }
.sf-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--sf-line); }
.sf-drawer__title { margin: 0; font-size: 18px; font-weight: 800; }
.sf-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sf-drawer__foot { padding: 16px; border-top: 1px solid var(--sf-line); background: #fff; }
#sf-drawer-cart .sf-cart-empty { display: none; }
#sf-drawer-cart.is-empty .sf-cart-empty { display: flex; }
#sf-drawer-cart.is-empty .sf-drawer__foot, #sf-drawer-cart.is-empty #sf-cart-items { display: none; }
.sf-cart-item.is-busy { opacity: .5; pointer-events: none; }

/* Menu drawer */
.sf-menu-user { display: flex; align-items: center; gap: 12px; margin: 14px 16px; padding: 14px; border-radius: var(--sf-radius); background: var(--sf-brand-soft); }
.sf-menu-user i { font-size: 28px; }
.sf-menu-user strong { display: block; }
.sf-menu-user small { color: var(--sf-ink-2); }
.sf-menu-section { padding: 6px 0; border-bottom: 1px solid var(--sf-line); }
.sf-menu-section__title { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--sf-muted); text-transform: uppercase; }
.sf-menu-link {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px;
    border: 0; background: transparent; text-align: start; font-size: 15px; color: var(--sf-ink);
}
.sf-menu-link:hover { background: var(--sf-surface); }
.sf-menu-link img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--sf-surface); }
.sf-menu-link i.fa-fw { color: var(--sf-muted); }
.sf-menu-link .sf-chevron { margin-inline-start: auto; color: var(--sf-muted); font-size: 12px; transition: transform .2s; }
.sf-menu-link[aria-expanded="true"] .sf-chevron { transform: rotate(180deg); }
.sf-menu-sub { padding: 0 0 6px; background: var(--sf-surface); }
.sf-menu-sub a { display: block; padding: 9px 16px 9px 16px; padding-inline-start: 62px; font-size: 14px; color: var(--sf-ink-2); }
.sf-lang-switch { display: flex; gap: 8px; padding: 12px 16px; }
.sf-lang-switch a { flex: 1; text-align: center; padding: 10px; border-radius: var(--sf-radius-sm); border: 1px solid var(--sf-line); font-weight: 700; font-size: 14px; }
.sf-lang-switch a.is-active { background: var(--sf-ink); color: #fff; border-color: var(--sf-ink); }

/* Cart drawer */
.sf-cart-item { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--sf-line); }
.sf-cart-item__img { width: 76px; height: 76px; border-radius: var(--sf-radius-sm); background: var(--sf-surface); object-fit: contain; }
.sf-cart-item__name { display: block; color: var(--sf-ink); font-size: 14px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-cart-item__opts { font-size: 12px; color: var(--sf-muted); }
.sf-cart-item__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sf-cart-item__price { font-weight: 800; font-size: 14px; }
.sf-cart-item__remove { border: 0; background: transparent; color: var(--sf-muted); font-size: 13px; padding: 4px; }
.sf-cart-item__remove:hover { color: var(--sf-danger); }
.sf-cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; padding: 40px 24px; text-align: center; color: var(--sf-muted); }
.sf-cart-empty i { font-size: 56px; color: var(--sf-line); }
.sf-cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 16px; }
.sf-cart-total strong { font-size: 20px; font-weight: 800; }
.sf-cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Qty stepper */
.sf-qty { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--sf-line); border-radius: 999px; overflow: hidden; }
.sf-qty button { width: 34px; height: 100%; border: 0; background: transparent; font-size: 14px; }
.sf-qty button:hover { background: var(--sf-surface); }
.sf-qty button[disabled] { opacity: .3; }
.sf-qty input { width: 36px; height: 100%; border: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.sf-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Sections ---------- */
.sf-section { padding-block: 28px; }
.sf-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sf-section__title { margin: 0; font-size: 22px; font-weight: 800; position: relative; padding-inline-start: 14px; }
.sf-section__title::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 5px; width: 5px; border-radius: 4px; background: var(--sf-brand); }
.sf-section__more { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.sf-section__more:hover { text-decoration: underline; }

@media (max-width: 575.98px) {
    .sf-section { padding-block: 20px; }
    .sf-section__title { font-size: 18px; }
}

/* Tabs */
.sf-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; padding-bottom: 2px; }
.sf-tabs::-webkit-scrollbar { display: none; }
.sf-tab {
    flex: none; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--sf-line);
    background: #fff; font-weight: 700; font-size: 14px; color: var(--sf-ink-2);
}
.sf-tab:hover { border-color: var(--sf-ink); }
.sf-tab.is-active { background: var(--sf-ink); border-color: var(--sf-ink); color: #fff; }

/* Horizontal scroller */
.sf-rail { position: relative; }
.sf-rail__track {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 10px;
}
.sf-rail__track::-webkit-scrollbar { display: none; }
.sf-rail__track > * { scroll-snap-align: start; }
.sf-rail__nav {
    position: absolute; inset-block-start: 40%; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
    border: 0; background: #fff; box-shadow: var(--sf-shadow); display: inline-flex; align-items: center; justify-content: center;
}
.sf-rail__nav--prev { inset-inline-start: -16px; }
.sf-rail__nav--next { inset-inline-end: -16px; }
.sf-rail__nav[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 1199.98px) { .sf-rail__track { grid-auto-columns: calc((100% - 3 * 14px) / 4); gap: 14px; } }
@media (max-width: 991.98px) { .sf-rail__track { grid-auto-columns: calc((100% - 2 * 12px) / 3); gap: 12px; } .sf-rail__nav { display: none; } }
@media (max-width: 575.98px) { .sf-rail__track { grid-auto-columns: 46%; gap: 10px; } }

/* Product grid */
.sf-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 1199.98px) { .sf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 991.98px) { .sf-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 575.98px) { .sf-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ---------- Product card ---------- */
.sf-card {
    position: relative; display: flex; flex-direction: column; height: 100%;
    background: #fff; border: 1px solid var(--sf-line); border-radius: var(--sf-radius);
    overflow: hidden; transition: box-shadow .2s, border-color .2s, transform .2s;
}
.sf-card:hover { border-color: transparent; box-shadow: var(--sf-shadow); transform: translateY(-2px); }
.sf-card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--sf-surface); }
.sf-card__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; mix-blend-mode: multiply; transition: transform .3s; }
.sf-card:hover .sf-card__media img { transform: scale(1.04); }
.sf-card__badges { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sf-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.6; }
.sf-tag--sale { background: var(--sf-danger); color: #fff; }
.sf-tag--new { background: var(--sf-ink); color: #fff; }
.sf-tag--out { background: #e5e5e5; color: var(--sf-ink-2); }
.sf-card__wish {
    position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08); color: var(--sf-ink-2); font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center; transition: transform .15s, color .15s;
}
.sf-card__wish:hover { transform: scale(1.08); }
.sf-card__wish.is-active { color: var(--sf-danger); }
.sf-card__body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 12px 12px 14px; }
.sf-card__name {
    margin: 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--sf-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.sf-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.sf-card__price-now { font-size: 16px; font-weight: 800; }
.sf-card__price-old { font-size: 13px; color: var(--sf-muted); text-decoration: line-through; }
.sf-card__cta { width: 100%; }
.sf-card.is-out .sf-card__media img { opacity: .55; }

@media (max-width: 575.98px) {
    .sf-card__body { padding: 10px 10px 12px; gap: 6px; }
    .sf-card__name { font-size: 13px; min-height: 39px; }
    .sf-card__price-now { font-size: 15px; }
    .sf-card__cta.sf-btn { min-height: 38px; font-size: 13px; padding: 0 10px; }
}

/* ---------- Home ---------- */
.sf-hero { position: relative; margin-top: 16px; }
.sf-hero__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--sf-radius); }
.sf-hero__track::-webkit-scrollbar { display: none; }
.sf-hero__slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.sf-hero__slide img { width: 100%; height: auto; aspect-ratio: 16 / 6; object-fit: cover; }
.sf-hero__dots { position: absolute; inset-block-end: 12px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; }
.sf-hero__dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .6); padding: 0; transition: width .2s; }
.sf-hero__dots button.is-active { width: 22px; background: #fff; }

.sf-cats { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.sf-cats::-webkit-scrollbar { display: none; }
.sf-cat { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; scroll-snap-align: start; }
.sf-cat__img {
    width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--sf-surface);
    border: 2px solid transparent; box-shadow: 0 0 0 2px var(--sf-line); transition: box-shadow .2s;
}
.sf-cat:hover .sf-cat__img { box-shadow: 0 0 0 3px var(--sf-brand); }
.sf-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.sf-cat__name { font-size: 13px; font-weight: 500; line-height: 1.35; max-width: 96px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 575.98px) {
    .sf-cats { grid-auto-columns: 74px; gap: 10px; }
    .sf-cat__img { width: 68px; height: 68px; }
    .sf-cat__name { font-size: 12px; max-width: 74px; }
}

.sf-banners { display: grid; gap: 16px; }
.sf-banners--2 { grid-template-columns: repeat(2, 1fr); }
.sf-banners--3 { grid-template-columns: repeat(3, 1fr); }
.sf-banner { display: block; overflow: hidden; border-radius: var(--sf-radius); background: var(--sf-surface); }
.sf-banner img { width: 100%; height: auto; transition: transform .4s; }
.sf-banner:hover img { transform: scale(1.03); }
@media (max-width: 767.98px) {
    .sf-banners--2, .sf-banners--3 { grid-template-columns: 1fr; gap: 12px; }
}

.sf-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sf-feature { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--sf-radius); background: var(--sf-surface); }
.sf-feature i { font-size: 26px; }
.sf-feature strong { display: block; font-size: 14px; }
.sf-feature span { font-size: 12px; color: var(--sf-muted); }
@media (max-width: 767.98px) { .sf-features { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Footer ---------- */
.sf-footer { margin-top: 40px; background: var(--sf-ink); color: rgba(255, 255, 255, .78); }
.sf-footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; padding-block: 48px 32px; }
.sf-footer__logo img { height: 56px; width: auto; filter: brightness(0) invert(1); }
.sf-footer__about { margin: 14px 0 18px; font-size: 14px; line-height: 1.8; }
.sf-footer__title { margin: 0 0 14px; color: #fff; font-size: 16px; font-weight: 800; }
.sf-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.sf-footer__links a:hover { color: var(--sf-brand); }
.sf-footer__contact li { display: flex; align-items: flex-start; gap: 10px; }
.sf-footer__contact i { color: var(--sf-brand); margin-top: 4px; }
.sf-social { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.sf-social a:hover { background: var(--sf-brand); color: var(--sf-ink); }
.sf-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }
.sf-footer__bottom a { color: #fff; }
.sf-footer__pay img { height: 28px; width: auto; }
.sf-newsletter { display: flex; gap: 8px; margin-top: 12px; }
.sf-newsletter input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); color: #fff; outline: none; }
.sf-newsletter input::placeholder { color: rgba(255, 255, 255, .5); }
.sf-newsletter input:focus { border-color: var(--sf-brand); }
@media (max-width: 991.98px) { .sf-footer__top { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 575.98px) {
    .sf-footer__top { grid-template-columns: 1fr; padding-block: 32px 20px; }
    .sf-footer__bottom { justify-content: center; text-align: center; }
}

/* ---------- Toasts ---------- */
.sf-toasts { position: fixed; inset-inline-end: 20px; inset-block-end: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.sf-toast {
    display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; padding: 12px 16px;
    border-radius: var(--sf-radius-sm); background: var(--sf-ink); color: #fff; box-shadow: var(--sf-shadow-lg);
    font-size: 14px; pointer-events: auto;
}
.sf-toast--error { background: var(--sf-danger); }
.sf-toast--success i { color: var(--sf-brand); }
@media (max-width: 991.98px) {
    .sf-toasts { inset-inline: 12px; inset-block-end: calc(var(--sf-bottombar-h) + 12px + env(safe-area-inset-bottom)); align-items: stretch; }
    .sf-toast { max-width: none; }
}

/* Cookie bar */
.sf-cookie {
    position: fixed; inset-inline: 16px; inset-block-end: 16px; z-index: 60; max-width: 520px;
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--sf-radius);
    background: #fff; box-shadow: var(--sf-shadow-lg); font-size: 14px;
}
@media (max-width: 991.98px) { .sf-cookie { inset-block-end: calc(var(--sf-bottombar-h) + 12px); } }

/* Breadcrumb */
.sf-breadcrumb { padding-block: 14px; font-size: 13px; color: var(--sf-muted); }
.sf-breadcrumb ul { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sf-breadcrumb li + li::before { content: "/"; margin-inline-end: 8px; color: var(--sf-line); }
.sf-breadcrumb a:hover { color: var(--sf-ink); }
.sf-breadcrumb li:last-child { color: var(--sf-ink); font-weight: 500; }

/* Page wrapper for legacy (Vue) pages rendered inside the new layout */
.sf-legacy { min-height: 40vh; }

.sf-search.is-loading .sf-search__field > i { animation: sf-spin .8s linear infinite; }
.sf-badge-count:empty { display: none; }
.sf-alert { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--sf-radius-sm); font-size: 14px; }
.sf-alert--success { background: #e8f7ee; color: #146c3c; }
.sf-alert--error { background: #fdecec; color: #a12626; }

/* ---------- Wordmark logo (used when no logo image is uploaded) ---------- */
.sf-wordmark {
    display: inline-flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; color: var(--sf-ink); white-space: nowrap;
}
.sf-wordmark::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--sf-brand); transform: rotate(45deg); }
.sf-wordmark--light { color: #fff; }
@media (max-width: 991.98px) { .sf-wordmark { font-size: 20px; } }

/* ---------- Bootstrap integration ---------- */
body.sf { font-family: var(--sf-font); }
.sf-dropdown { border: 0; border-radius: var(--sf-radius-sm); box-shadow: var(--sf-shadow-lg); padding: 8px; min-width: 220px; }
.sf-dropdown .dropdown-item { border-radius: 8px; padding: 9px 12px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.sf-dropdown .dropdown-item:active { background: var(--sf-brand); color: var(--sf-ink); }
.sf-card__name a { color: inherit; }
.sf-card__name a:hover { color: var(--sf-ink-2); }
.sf-card__name a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.sf-card__cta { position: relative; z-index: 2; }
.sf-card .sf-card__wish { position: absolute; z-index: 2; }
.sf-main { min-height: 50vh; }
.sf-legacy-page .sf-header, .sf-legacy-page .sf-footer, .sf-legacy-page .sf-bottombar, .sf-legacy-page .sf-drawer { font-family: var(--sf-font); }
.sf-legacy-page .sf-header ul, .sf-legacy-page .sf-footer ul { margin: 0; padding: 0; list-style: none; }

/* Bottom bar: raised home button in the middle */
.sf-bottombar__item--home { justify-content: center; }
.sf-bottombar__home {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
    padding-bottom: 8px; color: var(--sf-muted); font-size: 11px; font-weight: 500;
}
.sf-bottombar__home.is-active { color: var(--sf-ink); font-weight: 700; }
.sf-bottombar__home-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
    background: var(--sf-brand); color: var(--sf-ink); font-size: 22px;
    box-shadow: 0 0 0 5px #fff, 0 8px 20px rgba(242, 201, 0, .45);
    transition: transform .15s;
}
.sf-bottombar__home:active .sf-bottombar__home-btn { transform: scale(.94); }
.sf-bottombar__home.is-active .sf-bottombar__home-btn { background: var(--sf-ink); color: var(--sf-brand); box-shadow: 0 0 0 5px #fff, 0 8px 20px rgba(0, 0, 0, .25); }
.sf-bottombar { overflow: visible; }

/* ---------- Type scale (tuned for Tajawal, which renders large) ---------- */
body.sf { font-size: 14px; line-height: 1.65; }
.sf-section__title { font-size: 18px; font-weight: 700; }
.sf-section__title::before { inset-block: 4px; width: 4px; }
.sf-section__more { font-size: 13px; font-weight: 500; color: var(--sf-ink-2); }
.sf-nav__link { font-size: 14px; padding: 7px 12px; }
.sf-nav__cats-btn { font-weight: 600; }
.sf-header__account { font-size: 13px; font-weight: 600; }
.sf-topbar { font-size: 12px; }
.sf-search__field input, .sf-search__field button { font-size: 14px; }
.sf-search__field button { font-weight: 600; }
.sf-tab { font-size: 13px; font-weight: 600; padding: 7px 16px; }
.sf-card__name { font-size: 13px; font-weight: 400; line-height: 1.55; min-height: 40px; }
.sf-card__price-now { font-size: 15px; font-weight: 700; }
.sf-card__price-old { font-size: 12px; }
.sf-card__cta.sf-btn { font-size: 13px; font-weight: 600; }
.sf-tag { font-size: 10px; font-weight: 700; }
.sf-cat__name { font-size: 12.5px; font-weight: 500; }
.sf-feature strong { font-size: 13px; font-weight: 700; }
.sf-feature span { font-size: 12px; }
.sf-feature i { font-size: 22px; }
.sf-btn { font-size: 14px; font-weight: 600; }
.sf-footer__title { font-size: 15px; font-weight: 700; }
.sf-footer__links, .sf-footer__about { font-size: 13px; }
.sf-drawer__title { font-size: 16px; font-weight: 700; }
.sf-menu-link { font-size: 14px; }
.sf-wordmark { font-size: 21px; }
@media (max-width: 575.98px) {
    body.sf { font-size: 13.5px; }
    .sf-section__title { font-size: 16px; }
    .sf-card__name { font-size: 12.5px; min-height: 38px; }
    .sf-card__price-now { font-size: 14px; }
    .sf-card__cta.sf-btn { font-size: 12px; min-height: 36px; }
    .sf-tab { font-size: 12.5px; padding: 6px 14px; }
    .sf-cat__name { font-size: 11.5px; }
    .sf-wordmark { font-size: 18px; }
}

/* ---------- Logo size ---------- */
:root { --sf-header-h: 84px; }
.sf-header__logo img { height: 66px; width: auto; max-width: 220px; object-fit: contain; }
@media (max-width: 991.98px) {
    :root { --sf-header-h: 64px; }
    .sf-header__logo img { height: 50px; max-width: 170px; }
}
.sf-footer__logo img { height: 70px; }
:root { --sf-header-h: 96px; }
.sf-header__logo img { height: 82px; max-width: 240px; }
@media (max-width: 991.98px) {
    :root { --sf-header-h: 72px; }
    .sf-header__logo img { height: 64px; max-width: 180px; }
}
