/* LOMA demo store — design tokens + components. Mobile first, RTL. */
:root {
  --bg: #F7F6F3; --surface: #FFFFFF; --surface-2: #F1EFEA; --ink: #111214; --ink-2: #3A3D44; --muted: #6B6E76; --line: #E8E6E0;
  --accent: #E5482E; --accent-soft: #FDEBE7; --ok: #15803D; --ok-soft: #E7F6EC; --warn: #B45309; --warn-soft: #FEF3C7; --info: #1D4ED8; --info-soft: #DBEAFE;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(17,18,20,.05), 0 1px 0 rgba(17,18,20,.04); --sh-2: 0 10px 30px rgba(17,18,20,.10);
  --ease: cubic-bezier(.2, 0, 0, 1); --t-fast: 140ms; --t-med: 260ms; --t-slow: 420ms;
  --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body { font-family: 'Cairo', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, a { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.ic { width: 22px; height: 22px; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
img { display: block; max-width: 100%; }
.ph { background: var(--surface-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t-slow) var(--ease); }
.ph img.ok { opacity: 1; }

/* ---------- chrome ---------- */
.announce { background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; text-align: center; padding: 7px 12px; }
.announce b { color: #FFB4A6; }
.top { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: rgba(247,246,243,.88); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--t-med); }
.top.scrolled { border-color: var(--line); }
.top .title { flex: 1; font-weight: 800; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { flex: 1; font-family: 'Archivo Black', 'Cairo', sans-serif; font-size: 24px; letter-spacing: 3px; direction: ltr; text-align: right; }
.logo i { font-style: normal; color: var(--accent); }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; transition: background var(--t-fast), transform var(--t-fast) var(--ease); }
.icon-btn:active { transform: scale(.92); background: var(--surface-2); }
.count { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; transform: scale(0); transition: transform var(--t-med) var(--ease); }
.count.on { transform: scale(1); }
.count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.4); } }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); transition: transform var(--t-med) var(--ease); }
.tabbar.hide { transform: translateY(110%); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); position: relative; }
.tab .ic { width: 23px; height: 23px; }
.tab.on { color: var(--ink); }
.tab.on::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
.tab .count { top: 6px; left: calc(50% - 22px); }

#view { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); min-height: 70vh; }
#view.enter { animation: viewIn var(--t-slow) var(--ease) both; }
#view.enter-back { animation: viewBack var(--t-slow) var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateX(-18px); } }
@keyframes viewBack { from { opacity: 0; transform: translateX(18px); } }

/* ---------- home ---------- */
.hero { margin: 12px 12px 0; border-radius: var(--r-xl); overflow: hidden; position: relative; aspect-ratio: 4/4.6; max-height: 520px; color: #fff; }
.hero .ph { position: absolute; inset: 0; }
.hero .ph img { object-position: center 25%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.72) 100%); }
.hero-body { position: absolute; inset: auto 0 0 0; padding: 20px; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); padding: 4px 10px; border-radius: 999px; }
.hero h1 { font-size: 32px; line-height: 1.2; font-weight: 800; margin: 10px 0 14px; }
.btn-light { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; background: #fff; color: var(--ink); font-weight: 800; transition: transform var(--t-fast) var(--ease); }
.btn-light:active { transform: scale(.97); }
.btn-light .ic { width: 18px; height: 18px; transform: scaleX(-1); }

.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px; }
.perk { background: var(--surface); border-radius: var(--r-md); padding: 10px 8px; text-align: center; box-shadow: var(--sh-1); font-size: 12px; font-weight: 700; color: var(--ink-2); display: grid; gap: 4px; justify-items: center; }
.perk .ic { width: 20px; height: 20px; color: var(--accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 12px 4px; scrollbar-width: none; position: sticky; top: 60px; z-index: 20; background: var(--bg); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; color: var(--ink-2); transition: all var(--t-med) var(--ease); }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }

.sec-head { scroll-margin-top: 110px; display: flex; justify-content: space-between; align-items: baseline; padding: 18px 14px 10px; }
.sec-head h2 { font-size: 19px; font-weight: 800; }
.sec-head small { color: var(--muted); font-weight: 600; font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 10px; padding: 0 12px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 22px 16px; } .hero { aspect-ratio: 16/7; } .hero h1 { font-size: 44px; } }
.card { position: relative; animation: rise var(--t-slow) var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card .media { position: relative; aspect-ratio: 4/5; border-radius: var(--r-lg); overflow: hidden; display: block; width: 100%; }
.card .media .ph { position: absolute; inset: 0; }
.card .media img { transition: transform .6s var(--ease), opacity var(--t-slow) var(--ease); }
@media (hover: hover) { .card:hover .media img { transform: scale(1.04); } }
.badge { position: absolute; top: 10px; right: 10px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--ink); z-index: 1; }
.badge.sale { background: var(--accent); color: #fff; }
.fav { position: absolute; top: 6px; left: 6px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.88); backdrop-filter: blur(6px); z-index: 1; transition: transform var(--t-fast) var(--ease); }
.fav .ic { width: 19px; height: 19px; }
.fav.on { color: var(--accent); }
.fav.on .ic { fill: var(--accent); }
.fav:active { transform: scale(.85); }
.quick { position: absolute; bottom: 8px; left: 8px; width: 40px; height: 40px; border-radius: 13px; background: var(--ink); color: #fff; display: grid; place-items: center; z-index: 1; box-shadow: var(--sh-2); transition: transform var(--t-fast) var(--ease); }
.quick .ic { width: 20px; height: 20px; }
.quick:active { transform: scale(.88); }
.card .info { padding: 8px 2px 0; display: block; text-align: right; width: 100%; }
.card .name { font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.price-row { display: flex; gap: 6px; align-items: baseline; margin-top: 2px; }
.price { font-weight: 800; font-size: 15px; }
.old { color: var(--muted); text-decoration: line-through; font-size: 12.5px; font-weight: 600; }
.rate { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rate .ic { width: 13px; height: 13px; color: #F59E0B; fill: #F59E0B; }
.swatches { display: flex; gap: 4px; margin-top: 4px; }
.swatches i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

.promo { margin: 22px 12px 0; border-radius: var(--r-xl); background: var(--ink); color: #fff; padding: 22px 20px; display: grid; gap: 6px; position: relative; overflow: hidden; }
.promo::after { content: 'LOMA'; position: absolute; left: -8px; bottom: -22px; font-family: 'Archivo Black', sans-serif; font-size: 84px; opacity: .06; letter-spacing: 4px; }
.promo h3 { font-size: 21px; font-weight: 800; }
.promo p { color: #C9CBD1; font-size: 14px; }
.made { text-align: center; font-size: 12px; color: var(--muted); padding: 22px 0 6px; }
.made b { color: #0B4374; }

/* ---------- product page ---------- */
.p-media { position: relative; aspect-ratio: 4/5; max-height: 72vh; width: 100%; }
.p-media .ph { position: absolute; inset: 0; }
@media (min-width: 760px) { .p-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 1040px; margin: 16px auto; padding: 0 16px; } .p-media { border-radius: var(--r-xl); overflow: hidden; } }
.p-body { padding: 16px 16px 0; }
.p-body h1 { font-size: 23px; font-weight: 800; line-height: 1.35; }
.p-price { display: flex; align-items: baseline; gap: 10px; margin: 6px 0; }
.p-price .price { font-size: 22px; }
.p-price .save { font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.opt-label { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; margin: 18px 0 8px; }
.opt-label span { color: var(--muted); font-weight: 600; }
.sizes { display: flex; gap: 8px; }
.size { flex: 1; height: 48px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; transition: all var(--t-fast) var(--ease); }
.size.on { background: var(--ink); color: #fff; box-shadow: none; }
.colors { display: flex; gap: 10px; }
.color { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); position: relative; }
.color.on::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ink); }
.info-list { margin-top: 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.info-list div { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-list div:last-child { border: 0; }
.info-list .ic { width: 20px; height: 20px; color: var(--ink-2); }
.info-list b { display: block; font-size: 14px; }
.info-list small { color: var(--muted); }
.review { margin-top: 14px; background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); font-size: 14px; }
.review .who { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 4px; }
.review p { color: var(--ink-2); }

.buybar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 35; display: flex; gap: 10px; align-items: center; padding: 10px 14px calc(10px + var(--safe-b)); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); animation: barIn var(--t-slow) var(--ease) both; }
@keyframes barIn { from { transform: translateY(100%); } }
.buybar .sum { min-width: 0; }
.buybar .sum small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.buybar .sum b { font-size: 18px; font-weight: 800; white-space: nowrap; }
.btn { flex: 1; height: 54px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 800; font-size: 16.5px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform var(--t-fast) var(--ease), opacity var(--t-med); }
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cart ---------- */
.page-pad { padding: 4px 14px 0; max-width: 620px; margin: 0 auto; }
.ship-meter { background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--sh-1); font-size: 14px; font-weight: 700; margin: 8px 0 12px; }
.ship-meter .bar { height: 7px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.ship-meter .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #16A34A, #22C55E); transition: width .7s var(--ease); }
.ship-meter.done { color: var(--ok); }
.line { display: flex; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 10px; animation: rise var(--t-med) var(--ease) both; }
.line .thumb { width: 84px; aspect-ratio: 4/5; border-radius: var(--r-md); overflow: hidden; flex: none; position: relative; }
.line .thumb .ph { position: absolute; inset: 0; }
.line .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.line .meta b { font-size: 15px; }
.line .meta small { color: var(--muted); font-size: 13px; }
.line .bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.stepper button .ic { width: 17px; height: 17px; }
.stepper span { min-width: 22px; text-align: center; font-weight: 800; }
.promo-code { display: flex; gap: 8px; margin: 6px 0 12px; }
.promo-code input { flex: 1; height: 48px; border-radius: var(--r-md); border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); padding: 0 14px; outline: none; }
.promo-code button { height: 48px; padding: 0 18px; border-radius: var(--r-md); background: var(--surface-2); font-weight: 800; }
.totals { background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--sh-1); display: grid; gap: 6px; font-size: 14.5px; }
.totals div { display: flex; justify-content: space-between; }
.totals .free { color: var(--ok); font-weight: 800; }
.totals .grand { font-size: 17px; font-weight: 800; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .ic { width: 56px; height: 56px; color: var(--line); }
.empty b { color: var(--ink); font-size: 18px; }

/* ---------- checkout ---------- */
.steps { display: flex; align-items: center; gap: 6px; padding: 8px 14px 4px; max-width: 620px; margin: 0 auto; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.steps span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.steps i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--surface-2); font-size: 12px; }
.steps .done i { background: var(--ok); color: #fff; }
.steps .cur { color: var(--ink); }
.steps .cur i { background: var(--ink); color: #fff; }
.steps hr { flex: 1; border: 0; height: 2px; background: var(--line); border-radius: 1px; }
.form-card { background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); margin-top: 10px; }
.form-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.form-card h3 .ic { width: 19px; height: 19px; color: var(--accent); }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 5px; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; height: 50px; border-radius: var(--r-md); border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--bg); padding: 0 14px; font-size: 16px; outline: none; transition: box-shadow var(--t-fast), background var(--t-fast); appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6E76' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: left 14px center; }
.field textarea { height: 80px; padding: 12px 14px; resize: none; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--ink); background: #fff; }
.field .err { display: none; color: #DC2626; font-size: 13px; font-weight: 600; margin-top: 4px; }
.field.bad input, .field.bad textarea { box-shadow: inset 0 0 0 2px #DC2626; background: #FEF2F2; }
.field.bad .err { display: block; }
.field.good input { box-shadow: inset 0 0 0 1.5px #86EFAC; }
.pays { display: grid; gap: 8px; }
.pay { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow var(--t-fast); }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay .ic { width: 22px; height: 22px; color: var(--ink-2); }
.pay b { display: block; font-size: 14.5px; }
.pay small { color: var(--muted); font-size: 12.5px; }
.pay .dot { margin-inline-start: auto; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow var(--t-fast); }
.pay:has(input:checked) { box-shadow: inset 0 0 0 2px var(--ink); }
.pay:has(input:checked) .dot { box-shadow: inset 0 0 0 6px var(--ink); }
.mini-items { display: flex; gap: 8px; margin-bottom: 10px; }
.mini-items .ph { width: 48px; aspect-ratio: 4/5; border-radius: 10px; overflow: hidden; position: relative; }
.mini-items .ph img { position: absolute; inset: 0; }

/* ---------- success ---------- */
.done { text-align: center; padding: 26px 16px 0; max-width: 520px; margin: 0 auto; }
.check { width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 50%; background: var(--ok-soft); display: grid; place-items: center; animation: pop .55s var(--ease) both; }
.check svg { width: 50px; height: 50px; }
.check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s .25s var(--ease) forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h1 { font-size: 24px; font-weight: 800; }
.order-no { display: inline-block; background: var(--surface); box-shadow: var(--sh-1); padding: 4px 14px; border-radius: 10px; font-weight: 800; margin: 8px 0; }
.done > p { color: var(--muted); }
.timeline { text-align: right; background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); margin-top: 16px; display: grid; gap: 0; }
.tl { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ''; position: absolute; right: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; z-index: 1; }
.tl i .ic { width: 15px; height: 15px; }
.tl.on i { background: var(--ok); color: #fff; }
.tl b { display: block; font-size: 14.5px; }
.tl small { color: var(--muted); font-size: 12.5px; }
.wa { text-align: right; margin: 16px auto 0; background: #E7F6EC; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-size: 14px; box-shadow: var(--sh-1); opacity: 0; transform: translateY(10px) scale(.98); transition: all var(--t-slow) var(--ease); }
.wa.on { opacity: 1; transform: none; }
.wa .from { font-weight: 800; color: #128C3E; font-size: 13px; }
.wa time { display: block; text-align: left; color: var(--muted); font-size: 11px; }

.toast { position: fixed; top: 70px; left: 50%; transform: translate(-50%, -12px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: all var(--t-med) var(--ease); z-index: 90; display: flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: var(--sh-2); }
.toast .ic { width: 18px; height: 18px; color: #4ADE80; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

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