/* Electricity Shop — online store. Same palette as the shop system: ink + amber on warm paper. */
:root {
    --ink-900: #15181d; --ink-800: #1d2128; --ink-700: #2a2f38; --ink-600: #3b414c; --ink-400: #7a818d; --ink-300: #a3a9b3;
    --paper: #f7f5f0; --paper-2: #eeebe4; --line: #e4e0d7; --card: #fff;
    --amber: #f2a900; --amber-600: #d99700; --amber-50: #fff6dc;
    --green: #2e7d4f; --green-50: #e7f4ec; --red: #c2410c; --red-50: #fdeee6; --blue: #2563a8; --blue-50: #e7f0fa;
    --radius: 14px;
    --bs-body-font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    --bs-body-bg: var(--paper); --bs-body-color: var(--ink-800); --bs-border-color: var(--line);
    --bs-link-color: var(--ink-800); --bs-link-hover-color: var(--amber-600); --bs-link-color-rgb: 29, 33, 40;
}
html { font-size: 15px; }
body { min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
a { text-decoration: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed; }
.muted { color: var(--ink-400) !important; }
.fw-600 { font-weight: 600; }

/* ---------- header ---------- */
.topline { background: var(--ink-900); color: var(--ink-300); font-size: .82rem; padding: .35rem 0; }
.topline a { color: #fff; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1030; }
.site-header .bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink-900); font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, #ffbd1f, var(--amber)); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(242,169,0,.35); }
.brand-mark svg { width: 22px; height: 22px; }
.search { flex: 1; position: relative; max-width: 620px; }
.search input { width: 100%; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: .62rem 2.8rem .62rem 1rem; font-size: .95rem; }
.search input:focus { outline: none; border-color: var(--amber); background: #fff; box-shadow: 0 0 0 4px var(--amber-50); }
.search i { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: .45rem; background: var(--ink-900); color: #fff !important; border-radius: 12px; padding: .6rem 1rem; font-weight: 600; white-space: nowrap; }
.cart-btn:hover { background: var(--ink-700); }
.cart-count { background: var(--amber); color: var(--ink-900); border-radius: 10px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; padding: 0 .35rem; }
.cart-count.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.45); } }
.cats-strip { display: flex; gap: .5rem; overflow-x: auto; padding: 0 0 .75rem; scrollbar-width: none; }
.cats-strip::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--ink-700); border-radius: 999px; padding: .35rem .9rem; font-size: .88rem; font-weight: 500; }
.chip:hover, .chip.on { border-color: var(--ink-900); background: var(--ink-900); color: #fff; }
.chip small { opacity: .6; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% 0%, rgba(242,169,0,.22), transparent 60%), var(--ink-900); color: #fff; border-radius: 22px; padding: 3rem 2.5rem; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 700; line-height: 1.25; margin-bottom: .75rem; }
.hero h1 span { color: var(--amber); }
.hero p { color: var(--ink-300); font-size: 1.1rem; max-width: 560px; }
.hero .bolt { position: absolute; left: 4%; top: 50%; transform: translateY(-50%) rotate(-8deg); width: 230px; opacity: .12; }
.hero-perks { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.5rem; color: #e8eaee; font-size: .92rem; }
.hero-perks i { color: var(--amber); margin-inline-end: .35rem; }
.btn-amber { background: var(--amber); border-color: var(--amber); color: var(--ink-900); font-weight: 700; }
.btn-amber:hover, .btn-amber:focus { background: #ffbd1f; border-color: #ffbd1f; color: var(--ink-900); }
.btn-ink { background: var(--ink-900); border-color: var(--ink-900); color: #fff; font-weight: 600; }
.btn-ink:hover { background: var(--ink-700); color: #fff; }

.section-head { display: flex; align-items: end; justify-content: space-between; margin: 2.4rem 0 1rem; }
.section-head h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.section-head a { font-weight: 600; color: var(--amber-600); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.cat-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; color: var(--ink-800); display: flex; flex-direction: column; gap: .35rem; transition: transform .15s, border-color .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-3px); border-color: var(--amber); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.cat-tile i { font-size: 1.6rem; color: var(--amber-600); }
.cat-tile b { font-weight: 600; }

/* ---------- product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(21,24,29,.08); }
.pimg { aspect-ratio: 1; background: var(--paper-2); display: grid; place-items: center; position: relative; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pimg .ph { font-size: 3rem; color: var(--ink-300); }
.pimg .ph svg { width: 64px; opacity: .35; }
.badge-stock { position: absolute; top: .6rem; right: .6rem; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 600; }
.badge-stock.low { background: var(--amber-50); color: #8a5a00; }
.badge-stock.out { background: var(--red-50); color: var(--red); }
.pbody { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.pcat { font-size: .78rem; color: var(--ink-400); }
.pname { font-weight: 600; color: var(--ink-900); line-height: 1.45; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .4rem; gap: .5rem; }
.price { font-size: 1.2rem; font-weight: 700; color: var(--ink-900); }
.price small { font-size: .75rem; font-weight: 500; color: var(--ink-400); }
.add-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--amber); color: var(--ink-900); font-size: 1.25rem; display: grid; place-items: center; transition: transform .1s, background .15s; }
.add-btn:hover { background: #ffbd1f; }
.add-btn:active { transform: scale(.92); }
.add-btn:disabled { background: var(--paper-2); color: var(--ink-300); }

/* ---------- product page ---------- */
.pd-img { background: #fff; border: 1px solid var(--line); border-radius: 22px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.pd-img img { width: 100%; height: 100%; object-fit: contain; }
.pd-price { font-size: 2.2rem; font-weight: 700; }
.qty { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { width: 44px; border: 0; background: transparent; font-size: 1.2rem; }
.qty input { width: 70px; border: 0; text-align: center; font-weight: 600; }
.qty input:focus { outline: none; }
.avail { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.avail.ok { color: var(--green); } .avail.low { color: #8a5a00; } .avail.out { color: var(--red); }
.perk-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .55rem; color: var(--ink-600); }
.perk-list i { color: var(--amber-600); margin-inline-end: .45rem; }

/* ---------- cart / checkout ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cart-row { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-row .pimg { width: 84px; border-radius: 12px; flex-shrink: 0; }
.summary .row-t { display: flex; justify-content: space-between; padding: .5rem 0; }
.summary .grand { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--ink-900); margin-top: .5rem; padding-top: .8rem; font-weight: 700; font-size: 1.25rem; }
.form-control, .form-select { border-radius: 10px; padding: .6rem .85rem; border-color: var(--line); }
.form-control:focus { border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-50); }
.flash { border-radius: 12px; padding: .8rem 1rem; display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.flash-err { background: var(--red-50); color: var(--red); }
.flash-info { background: var(--amber-50); color: #6b4b00; }
.flash-err ul { margin: 0; padding-inline-start: 1rem; }
.validation-summary-valid { display: none; }

/* ---------- order status ---------- */
.done-icon { width: 92px; height: 92px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; font-size: 3rem; margin: 0 auto 1rem; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; position: relative; }
.timeline .step { text-align: center; position: relative; color: var(--ink-400); font-weight: 600; font-size: .9rem; }
.timeline .dot { width: 38px; height: 38px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; margin: 0 auto .45rem; position: relative; z-index: 1; }
.timeline .step.on { color: var(--ink-900); }
.timeline .step.on .dot { background: var(--amber); color: var(--ink-900); }
/* RTL: each step joins the previous one, which sits on its right */
.timeline .step:not(:first-child)::before { content: ""; position: absolute; top: 19px; left: 50%; width: 100%; height: 3px; background: var(--paper-2); }
.timeline .step.on:not(:first-child)::before { background: var(--amber); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink-900); color: var(--ink-300); margin-top: 3rem; padding: 2.4rem 0 1.4rem; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: .8rem; }
.site-footer a { color: var(--ink-300); }
.site-footer a:hover { color: var(--amber); }
.site-footer .copy { border-top: 1px solid var(--ink-700); margin-top: 1.6rem; padding-top: 1rem; font-size: .85rem; }

/* toast */
.toast-box { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 140%); background: var(--ink-900); color: #fff; padding: .8rem 1.2rem; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); display: flex; gap: .8rem; align-items: center; z-index: 2000; transition: transform .3s ease, opacity .3s ease, visibility .3s; max-width: 92vw; opacity: 0; visibility: hidden; }
.toast-box.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast-box a { color: var(--amber); font-weight: 700; white-space: nowrap; }

@media (max-width: 767.98px) {
    .site-header .bar { flex-wrap: wrap; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .brand { flex: 1; }
    .hero { padding: 2rem 1.4rem; border-radius: 18px; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
    .pbody { padding: .7rem; }
    .price { font-size: 1.05rem; }
    .add-btn { width: 38px; height: 38px; }
}
