/* =========================================================
   Layout: Topbar, Header, Nav, Search, Sheets, Tabbar, Footer, Toast, Splash
   ========================================================= */
.skip-link { position: absolute; top: -60px; inset-inline-start: 16px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); }
.skip-link:focus { top: 12px; }
#app-main { outline: none; min-height: 60vh; }

/* Topbar */
.topbar { background: var(--olive-800); color: var(--olive-100); font-size: var(--fs-xs); }
.topbar-row { display: flex; align-items: center; justify-content: space-between; min-height: 36px; gap: 16px; }
.topbar-msg { display: flex; align-items: center; gap: 8px; }
.topbar-msg .sep { opacity: .5; margin-inline: 4px; }
.topbar-links { display: flex; gap: 20px; }
.topbar-links a { opacity: .85; transition: opacity var(--t-fast); }
.topbar-links a:hover { opacity: 1; }
@media (max-width: 767px) { .topbar-row { justify-content: center; } .topbar-msg { font-size: 11.5px; } }

/* Header */
.hdr { position: sticky; top: 0; z-index: 60; background: rgba(251, 247, 241, .96); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid transparent; transition: border-color var(--t), box-shadow var(--t); }
.hdr.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 18px -14px rgba(36, 34, 28, .3); }
.hdr-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.logo img { border-radius: 50%; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-size: 20px; font-weight: 700; color: var(--olive-600); letter-spacing: 0; }
.logo-tag { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.hdr-actions { display: flex; align-items: center; gap: 4px; }
.cart-count { position: absolute; top: 6px; inset-inline-end: 4px; min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 9px; background: var(--olive-600); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.cart-count[hidden] { display: none; }

@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .hdr-row { grid-template-columns: 44px 1fr 44px; grid-template-areas: "menu logo cart" "search search search"; row-gap: 0; padding-bottom: 10px; }
  .hdr-menu { grid-area: menu; }
  .hdr .logo { grid-area: logo; justify-self: center; gap: 8px; }
  .hdr .logo img { width: 38px; height: 38px; }
  .hdr .logo-name { font-size: 18px; }
  .hdr .logo-tag { display: none; }
  .hdr-actions { grid-area: cart; }
  .hdr .search { grid-area: search; }
}

/* Search */
.search { position: relative; width: 100%; max-width: 620px; justify-self: center; }
.search-input { width: 100%; height: 46px; padding-inline: 44px 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); font-size: var(--fs-base); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus { outline: none; border-color: var(--olive-600); box-shadow: 0 0 0 3px var(--olive-100); }
.search-input::placeholder { color: var(--ink-4); }
.search-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; display: flex; }
.search-clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: none; place-items: center; color: var(--ink-3); border-radius: 50%; }
.search-clear:hover { background: var(--sand-100); color: var(--ink); }
.search.has-value .search-clear { display: grid; }
.search-pop { position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 8px; display: none; z-index: 70; max-height: min(70vh, 560px); overflow: auto; }
.search.is-open .search-pop { display: block; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sp-label { font-size: var(--fs-xs); color: var(--ink-3); padding: 6px 10px 2px; }
.sp-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); }
.sp-item:hover, .sp-item.is-active { background: var(--sand-50); }
.sp-media { width: 48px; height: 48px; border-radius: 6px; }
.sp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.sp-name { font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-brand { font-size: var(--fs-xs); color: var(--ink-3); }
.sp-item .price { font-size: var(--fs-sm); }
.sp-all { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; margin-top: 6px; border-top: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 500; color: var(--olive-700); border-radius: 0 0 6px 6px; }
.sp-all:hover, .sp-all.is-active { background: var(--olive-50); }
.sp-empty { padding: 18px 12px; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
.sp-empty a { color: var(--olive-700); text-decoration: underline; text-underline-offset: 3px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding-inline: 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--paper); font-size: var(--fs-sm); color: var(--ink-2); transition: all var(--t-fast); white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip small { color: var(--ink-4); }

/* Nav */
.nav { border-top: 1px solid var(--line); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-list { display: flex; list-style: none; gap: 4px; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; height: 48px; padding-inline: 12px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); position: relative; transition: color var(--t-fast); white-space: nowrap; }
.nav-link .i { opacity: .55; transition: transform var(--t); }
.nav-link::after { content: ''; position: absolute; inset-inline: 12px; bottom: -1px; height: 2px; background: var(--olive-600); transform: scaleX(0); transition: transform var(--t) var(--ease); }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { transform: scaleX(1); }
.nav-sale { color: var(--sale); }
.nav-sale:hover { color: var(--sale); }
.nav-menu { position: absolute; top: 100%; inset-inline-start: 0; padding-top: 1px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .2s var(--ease); z-index: 65; }
.nav-item.has-menu:hover .nav-menu, .nav-item.has-menu:focus-within .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-item.has-menu:hover .nav-link .i { transform: rotate(180deg); }
.nav-menu-inner { display: grid; grid-template-columns: 280px 240px; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: var(--shadow-pop); padding: 10px; }
.nav-menu-list { display: flex; flex-direction: column; }
.nav-menu-list a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--r-sm); line-height: 1.45; }
.nav-menu-list a:hover { background: var(--sand-50); }
.nav-menu-list a span { font-weight: 500; font-size: var(--fs-base); }
.nav-menu-list a small { color: var(--ink-3); font-size: var(--fs-xs); }
.nav-menu-list .nav-menu-all { flex-direction: row; align-items: center; justify-content: space-between; color: var(--olive-700); font-weight: 600; font-size: var(--fs-sm); border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
.nav-menu-media { border-radius: var(--r-sm); aspect-ratio: auto; min-height: 220px; display: block; }
.nav-menu-media img { position: absolute; inset: 0; }
.nav-menu-media span { position: absolute; inset-inline: 0; bottom: 0; padding: 14px; color: #fff; font-size: var(--fs-sm); line-height: 1.5; background: rgba(36, 34, 28, .62); }
@media (max-width: 1100px) { .nav-link { padding-inline: 8px; font-size: 14px; } .nav-aux { display: none; } }

/* Sheets */
.sheet { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.sheet.is-open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(36, 34, 28, .42); opacity: 0; transition: opacity .28s var(--ease); }
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet-panel { position: absolute; top: 0; bottom: 0; width: min(420px, 92vw); background: var(--cream); display: flex; flex-direction: column; transition: transform .32s var(--ease); box-shadow: var(--shadow-pop); }
.sheet-start .sheet-panel { inset-inline-start: 0; transform: translateX(100%); }
.sheet-end .sheet-panel { inset-inline-end: 0; transform: translateX(-100%); }
.sheet.is-open .sheet-panel { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 12px; border-bottom: 1px solid var(--line); }
.sheet-head .logo-tag { display: none; }
.sheet-title { font-size: var(--fs-lg); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 20px 24px; overscroll-behavior: contain; }
.sheet-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); display: grid; gap: 8px; }
.sheet-foot:empty { display: none; }
.sheet-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.6; }
.sheet-note .i { margin-top: 2px; }
.m-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); margin: 20px 0 6px; letter-spacing: 0; }
.m-list { list-style: none; }
.m-link { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; font-size: var(--fs-md); font-weight: 500; border-bottom: 1px solid var(--line); text-align: start; }
.m-list-sm .m-link { font-size: var(--fs-base); font-weight: 400; min-height: 44px; color: var(--ink-2); }
.m-link .i { transition: transform var(--t); color: var(--ink-3); }
.m-acc.is-open > .m-link .i { transform: rotate(180deg); }
.m-sub { display: none; padding: 4px 0 10px; }
.m-acc.is-open .m-sub { display: grid; }
.m-sub a { padding: 10px 14px; color: var(--ink-2); border-inline-start: 2px solid var(--line); }
.m-sub a:first-child { color: var(--olive-700); font-weight: 500; }
.m-wa { margin-top: 24px; }

/* Tabbar */
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar > * { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 58px; font-size: 11px; color: var(--ink-3); }
.tabbar .is-active { color: var(--olive-700); }
.tabbar .cart-count { top: 4px; inset-inline-end: calc(50% - 22px); }
@media (max-width: 767px) { body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); } }

/* Footer */
.ftr { margin-top: var(--section-gap); background: var(--olive-900); color: #D9DCC9; }
.ftr-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) 1.3fr; gap: 40px; padding-block: 64px 48px; }
.ftr .logo-name { color: #fff; }
.ftr .logo-tag { color: var(--olive-300); }
.ftr-desc { margin-top: 18px; font-size: var(--fs-sm); line-height: 1.85; color: #B9BDA5; max-width: 340px; }
.ftr-social { display: flex; gap: 4px; margin-top: 18px; margin-inline-start: -10px; }
.ftr-social .icon-btn { color: #D9DCC9; }
.ftr-social .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ftr-col h3 { font-size: var(--fs-sm); font-weight: 600; color: #fff; margin-bottom: 16px; }
.ftr-col ul { list-style: none; display: grid; gap: 10px; }
.ftr-col a, .ftr-col span { font-size: var(--fs-sm); color: #B9BDA5; transition: color var(--t-fast); }
.ftr-col a:hover { color: #fff; }
.ftr-contact li { display: flex; gap: 10px; align-items: flex-start; }
.ftr-contact .i { margin-top: 4px; color: var(--gold-500); }
.ftr-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: var(--fs-xs); color: #979B84; }
.ftr-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.ftr-legal a:hover { color: #fff; }
@media (max-width: 1100px) { .ftr-top { grid-template-columns: repeat(3, 1fr); } .ftr-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) { .ftr-top { grid-template-columns: 1fr 1fr; gap: 32px 20px; padding-block: 48px 32px; } .ftr-contact { grid-column: 1 / -1; } }

/* Toast */
.toast { position: fixed; z-index: 120; bottom: 24px; inset-inline-start: 50%; transform: translate(50%, 20px); opacity: 0; visibility: hidden; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 10px 10px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-pop); width: max-content; max-width: calc(100vw - 32px); transition: all .3s var(--ease); }
.toast.is-on { opacity: 1; visibility: visible; transform: translate(50%, 0); }
.toast > span:not(.media) { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.toast b { font-size: var(--fs-sm); font-weight: 600; }
.toast small { font-size: var(--fs-xs); color: #C9C4BA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.toast-media { width: 40px; height: 40px; border-radius: 6px; flex: none; }
.toast-link { margin-inline-start: 8px; height: 34px; padding-inline: 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .12); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.toast-link:hover { background: rgba(255, 255, 255, .2); }
@media (max-width: 767px) { .toast { bottom: calc(70px + env(safe-area-inset-bottom)); } }

/* Splash — صورة ترويجية مع خلفية معتمة ومضببة */
.splash { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px; }
.splash-backdrop { position: absolute; inset: 0; background: rgba(28, 26, 21, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s var(--ease); cursor: pointer; }
.splash-card { position: relative; width: min(460px, 100%); opacity: 0; transform: translateY(16px) scale(.97); transition: all .45s var(--ease); }
.splash.is-on .splash-backdrop { opacity: 1; }
.splash.is-on .splash-card { opacity: 1; transform: none; }
.splash-poster { display: block; aspect-ratio: 4 / 5; max-height: calc(100vh - 48px); border-radius: var(--r-lg); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.splash-poster img { position: absolute; inset: 0; }
.splash-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(28, 26, 21, .88) 0%, rgba(28, 26, 21, .55) 32%, rgba(28, 26, 21, 0) 60%); }
.splash-copy { position: absolute; inset-inline: 0; bottom: 0; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #fff; }
.splash-eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--gold-200); }
.splash-title { font-size: clamp(24px, 4vw, 30px); font-weight: 700; line-height: 1.35; }
.splash-text { font-size: var(--fs-sm); color: rgba(255, 255, 255, .82); }
.splash-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; height: 46px; padding-inline: 20px; border-radius: var(--r-sm); background: var(--cream); color: var(--ink); font-weight: 600; font-size: var(--fs-sm); transition: background var(--t-fast); }
.splash-poster:hover .splash-cta { background: #fff; }
.splash-poster:hover img { transform: scale(1.02); }
.splash-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: var(--shadow-2); transition: transform var(--t-fast); }
.splash-x:hover { transform: rotate(90deg); }
@media (max-width: 640px) { .splash { padding: 16px; } .splash-copy { padding: 22px; } }

.eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--olive-600); letter-spacing: 0; }
