/* ============================================================================
   Singaf storefront
   Hand-written: Hostinger shared hosting has no Node build step, so there is
   no Tailwind/PostCSS pass. Layout uses CSS *logical* properties
   (margin-inline, inset-inline, border-start) so the Arabic RTL view is the
   same stylesheet flipped by dir="rtl" - no second file, no mirrored rules.
   ========================================================================= */

:root {
    /* Sampled from the app's own screens: #d58b14 is by far the most
       common saturated pixel (the buttons and selected states), on an
       otherwise white/#fafafa UI. Matching the app, not the portal logo. */
    --brand: #d58b14;
    --brand-dark: #b3730c;
    --brand-light: #fdf4e3;
    --brand-glow: rgba(213, 139, 20, .30);

    /* Text sitting on a gold fill. White on #d58b14 is only 2.76:1,
       under the 4.5:1 minimum; near-black on the same gold is 7.6:1,
       so the button keeps the app's colour and stays legible. */
    --on-brand: #1c1305;

    --ink: #111111;
    --ink-2: #4a4a4a;
    --ink-3: #8a8a8a;

    --line: #e2e2e2;
    --surface: #ffffff;
    --canvas: #fafafa;

    --sale: #d92d20;
    --ok: #067647;

    --r-sm: 8px;
    --r: 14px;
    --r-lg: 20px;

    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --shadow-lg: 0 12px 40px -12px rgba(16, 24, 40, .22);

    --wrap: 1240px;
    --header-h: 62px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 400 15px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow-x: hidden; /* a single wide child must never scroll the page */
}

/* Arabic gets a face that actually has the glyphs, and a touch more leading. */
html[dir="rtl"] body {
    font-family: "Noto Kufi Arabic", "Tahoma", "Segoe UI", system-ui, sans-serif;
    line-height: 1.7;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

/* Numbers and prices stay LTR even in the Arabic view, or "12.500 OMR"
   renders as "OMR 500.12" and quietly misreads. */
.num, .price, bdi { direction: ltr; unicode-bidi: isolate; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 16px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

/* ── header ──────────────────────────────────────────────────────────────── */

.hdr {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(12px);
    border-block-end: 1px solid var(--line);
}

.hdr-in {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -.02em;
    color: var(--brand);
    flex: none;
}

.brand img { height: 30px; width: auto; }

.hdr-search { flex: 1 1 auto; min-width: 0; }

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding-inline: 14px;
    height: 40px;
    transition: border-color .15s, box-shadow .15s;
}

.search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
    background: var(--surface);
}

.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    color: var(--ink);
}

.search svg { flex: none; color: var(--ink-3); }

.hdr-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding-inline: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
}

.lang:hover { border-color: var(--brand); color: var(--brand); }

/* ── category strip ──────────────────────────────────────────────────────── */

.catbar {
    background: var(--surface);
    border-block-end: 1px solid var(--line);
}

.catbar-in {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 9px;
}

.catbar-in::-webkit-scrollbar { display: none; }

.catbar a {
    flex: none;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
}

.catbar a:hover { background: var(--brand-light); color: var(--brand); }

.catbar a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }

/* ── hero / sliders ──────────────────────────────────────────────────────── */

.hero {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-block: 18px;
    padding-block-end: 4px;
}

.hero::-webkit-scrollbar { display: none; }

.hero figure {
    flex: 0 0 100%;
    scroll-snap-align: center;
    margin: 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    aspect-ratio: 21 / 8;
}

.hero img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 760px) {
    .hero figure { flex: 0 0 calc(50% - 6px); }
    .hero:has(figure:only-child) figure { flex: 0 0 100%; }
}

/* ── section headings ────────────────────────────────────────────────────── */

.sec { margin-block: 30px; }

.sec-hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 14px;
}

.sec-hd h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.015em;
}

.sec-hd .more {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    white-space: nowrap;
}

/* ── product grid ────────────────────────────────────────────────────────── */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 620px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* A horizontal rail on small screens, a plain grid once there is room. */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 46%;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-inline: -16px;
    padding-inline: 16px;
}

.rail::-webkit-scrollbar { display: none; }

.rail > * { scroll-snap-align: start; }

@media (min-width: 620px) {
    .rail {
        grid-auto-flow: row;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-columns: auto;
        overflow: visible;
        margin-inline: 0;
        padding-inline: 0;
        gap: 16px;
    }
}

@media (min-width: 960px)  { .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .rail { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .18s, transform .18s, border-color .18s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #d3d7e6;
    transform: translateY(-2px);
}

.card-img {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--brand-light);
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 10px 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.card-store {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: .04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
    /* two lines, then ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    margin-block-start: auto;
    padding-block-start: 6px;
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.price {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

.price s {
    font-weight: 500;
    font-size: 12.5px;
    color: var(--ink-3);
}

.badge {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    background: var(--sale);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: .01em;
}

.badge.soldout {
    background: rgba(22, 24, 31, .82);
    inset-inline-start: auto;
    inset-inline-end: 8px;
}

/* ── store cards ─────────────────────────────────────────────────────────── */

.stores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.store-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow .18s, border-color .18s;
}

.store-card:hover { box-shadow: var(--shadow); border-color: #d3d7e6; }

.store-card .logo {
    width: 62px;
    height: 62px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--brand-light);
    display: grid;
    place-items: center;
    overflow: hidden;
    font-weight: 700;
    color: var(--brand);
    font-size: 21px;
}

.store-card .logo img { width: 100%; height: 100%; object-fit: cover; }

.store-card b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── product detail ──────────────────────────────────────────────────────── */

.pdp {
    display: grid;
    gap: 22px;
    margin-block: 20px;
}

@media (min-width: 900px) {
    .pdp { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
}

.pdp-media {
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    aspect-ratio: 3 / 4;
}

.pdp-media > * { width: 100%; height: 100%; object-fit: cover; }

.pdp-media-empty { background: var(--brand-light); }

/* More than one asset: a swipeable strip. No JS and no carousel library -
   the browser's own scroll-snap is smoother than either. */
.pdp-media.is-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.pdp-media.is-strip::-webkit-scrollbar { display: none; }

.pdp-media.is-strip > * { scroll-snap-align: center; }

.pdp-media-wrap > .note { margin-block: 8px 0; text-align: start; }

@media (min-width: 900px) {
    .pdp-media-wrap { position: sticky; top: calc(var(--header-h) + 16px); }
}

.pdp-info > * + * { margin-block-start: 16px; }

.pdp h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.02em;
}

.pdp .store-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
}

.pdp .store-line .logo {
    width: 26px; height: 26px; border-radius: 50%;
    overflow: hidden; background: var(--brand-light); flex: none;
}

.pdp-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.pdp-price .price { font-size: 27px; }

.pdp-price .off {
    background: #fef3f2;
    color: var(--sale);
    font-size: 12.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

.stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
}

.stock.in { color: var(--ok); }
.stock.out { color: var(--ink-3); }

.stock::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.opt { margin: 0; padding: 0; border: 0; }

.opt legend {
    padding: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-block-end: 8px;
}

.opt-list { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 12px 6px 8px;
    font-size: 13px;
    font-weight: 500;
}

html[dir="rtl"] .swatch { padding: 6px 8px 6px 12px; }

.swatch i {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(16, 24, 40, .16);
    flex: none;
}

.size {
    min-width: 44px;
    text-align: center;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 600;
}

.desc {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.7;
    white-space: pre-line;
}

/* The app is the only place that can take money today, so the storefront's
   primary action is an honest hand-off rather than a dead "Add to cart". */
.cta-stack { display: grid; gap: 9px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding-inline: 22px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 650;
    text-align: center;
    transition: background .15s, box-shadow .15s, border-color .15s;
}

.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; box-shadow: 0 0 0 3px var(--brand-glow); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.note {
    font-size: 12.5px;
    color: var(--ink-3);
    text-align: center;
}

/* ── listing toolbar ─────────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-block: 20px 16px;
}

.toolbar h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.toolbar .count { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }

.sortsel {
    height: 38px;
    padding-inline: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    font: inherit;
    font-size: 14px;
    color: var(--ink);
}

.store-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    margin-block: 18px 4px;
}

.store-hero .logo {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--brand-light); overflow: hidden; flex: none;
    display: grid; place-items: center; font-weight: 700; color: var(--brand); font-size: 22px;
}

.store-hero h1 { font-size: 20px; margin: 0 0 2px; }
.store-hero p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* ── empty state ─────────────────────────────────────────────────────────── */

.empty {
    text-align: center;
    padding: 64px 20px;
    color: var(--ink-3);
}

.empty svg { margin: 0 auto 14px; color: #c8cddd; }

.empty h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }

.empty p { margin: 0; font-size: 14px; }

/* ── pagination ──────────────────────────────────────────────────────────── */

.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-block: 30px;
}

.pager a, .pager span {
    min-width: 40px;
    height: 40px;
    padding-inline: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.pager a:hover { border-color: var(--brand); color: var(--brand); }

.pager .on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.pager .off { opacity: .45; }

/* Laravel's default pagination markup ships arrows as raw SVG; keep them small. */
.pager svg { width: 16px; height: 16px; }

/* ── app hand-off banner ─────────────────────────────────────────────────── */

.appbar {
    background: linear-gradient(100deg, #8a5a08 0%, var(--brand) 100%);
    color: #fff;
    border-radius: var(--r-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-block: 32px;
}

.appbar h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.appbar p { margin: 0; font-size: 14px; opacity: .9; }

.appbar .links { display: flex; gap: 9px; flex-wrap: wrap; }

.appbar .links a {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding-inline: 18px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    font-size: 14px;
    font-weight: 650;
    backdrop-filter: blur(4px);
}

.appbar .links a:hover { background: rgba(255, 255, 255, .26); }

/* ── footer ──────────────────────────────────────────────────────────────── */

.ftr {
    margin-block-start: 44px;
    border-block-start: 1px solid var(--line);
    background: var(--surface);
    padding-block: 26px;
    color: var(--ink-3);
    font-size: 13.5px;
}

.ftr-in {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.ftr nav { display: flex; gap: 16px; flex-wrap: wrap; }

.ftr nav a:hover { color: var(--brand); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
    .card:hover { transform: none; }
}

/* ============================================================================
   Buying: cart, checkout, sign-in, account
   ========================================================================= */

/* ── header extras ───────────────────────────────────────────────────────── */

.iconbtn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    flex: none;
}

.iconbtn:hover { border-color: var(--brand); color: var(--brand); }

.iconbtn .dot {
    position: absolute;
    inset-block-start: -5px;
    inset-inline-end: -5px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: 999px;
    background: var(--brand-dark);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
}

/* ── flash messages ──────────────────────────────────────────────────────── */

.flash {
    margin-block: 16px 0;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
}

.flash-err { background: #fef3f2; border-color: #fecdc9; color: #912018; }
.flash-ok  { background: #ecfdf3; border-color: #abefc6; color: #067647; }

/* ── two-column cart / checkout ──────────────────────────────────────────── */

.cartgrid {
    display: grid;
    gap: 18px;
    margin-block: 18px 8px;
    align-items: start;
}

@media (min-width: 900px) {
    .cartgrid { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
}

.lines { display: grid; gap: 12px; min-width: 0; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 18px;
}

.panel > h2 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
}

/* ── a cart line ─────────────────────────────────────────────────────────── */

.line {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 12px;
}

@media (min-width: 640px) {
    .line { grid-template-columns: 96px minmax(0, 1fr) auto; align-items: start; }
}

.line-img {
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--brand-light);
    aspect-ratio: 3 / 4;
}

.line-img img { width: 100%; height: 100%; object-fit: cover; }

.line-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.line-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.line-name:hover { color: var(--brand); }

.line-meta { margin: 0; font-size: 13px; color: var(--ink-3); }

.line-actions {
    margin-block-start: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.qtyform { display: flex; align-items: center; gap: 8px; }

.qty {
    width: 68px;
    height: 36px;
    padding-inline: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    font: inherit;
    font-size: 14px;
    color: var(--ink);
}

.qty:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.linkbtn {
    border: 0;
    background: none;
    padding: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.linkbtn:hover { color: var(--brand-dark); }
.linkbtn.danger { color: var(--sale); }

.line-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    grid-column: 1 / -1;
}

@media (min-width: 640px) {
    .line-price { grid-column: auto; align-items: flex-end; text-align: end; }
}

/* ── summary rail ────────────────────────────────────────────────────────── */

.summary {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 18px;
    display: grid;
    /* An implicit `auto` track takes its minimum from the widest item's
       min-content, which a long line of text can push past the column
       width - the overflow then lands off the left edge in RTL.
       minmax(0, 1fr) lets the track shrink instead. */
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    box-shadow: var(--shadow);
}

/* Same guard for every direct child of the two-column layouts: a grid
   item defaults to min-width:auto and will not shrink below its content. */
.cartgrid > * { min-width: 0; }

.summary .sumrow > span,
.summary .note { min-width: 0; overflow-wrap: anywhere; }

.summary h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }

.summary .btn { width: 100%; }

@media (min-width: 900px) {
    .summary { position: sticky; top: calc(var(--header-h) + 16px); }
}

.sumrow {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 14.5px;
    color: var(--ink-2);
}

.sumrow b { color: var(--ink); font-size: 15px; }
.sumrow i { font-style: normal; font-size: 12.5px; color: var(--ink-3); }
.sumrow.ok, .sumrow.ok b { color: var(--ok); }

.sumrow.total {
    margin-block-start: 6px;
    padding-block-start: 12px;
    border-block-start: 1px solid var(--line);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.sumrow.total b { font-size: 20px; }

.promo { display: flex; gap: 8px; margin-block-end: 6px; }

.promo input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding-inline: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--canvas);
    font: inherit;
    font-size: 14px;
    text-transform: uppercase;
}

.promo input:focus {
    outline: 0;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.promo .btn { width: auto; height: 42px; padding-inline: 16px; flex: none; }

/* ── compact order lines on checkout ─────────────────────────────────────── */

.colline {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-block: 8px;
    border-block-start: 1px solid var(--line);
}

.colline:first-of-type { border-block-start: 0; }

.colline-img {
    border-radius: 6px;
    overflow: hidden;
    background: var(--brand-light);
    aspect-ratio: 3 / 4;
}

.colline-img img { width: 100%; height: 100%; object-fit: cover; }

.colline-name { font-size: 14px; min-width: 0; }
.colline-name i { font-style: normal; color: var(--ink-3); font-size: 13px; }

/* ── address picker ──────────────────────────────────────────────────────── */

.addrlist { display: grid; gap: 10px; margin-block-end: 14px; }

.addr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink-2);
    cursor: pointer;
}

.addr:hover { border-color: #c9cee1; }

.addr.on {
    border-color: var(--brand);
    background: var(--brand-light);
}

.addr b { color: var(--ink); }

.newaddr > summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    padding-block: 6px;
}

/* ── forms ───────────────────────────────────────────────────────────────── */

.formgrid {
    display: grid;
    gap: 12px;
    margin-block-start: 12px;
}

@media (min-width: 620px) {
    .formgrid { grid-template-columns: 1fr 1fr; }
    .formgrid .wide { grid-column: 1 / -1; }
}

.formstack { display: grid; gap: 14px; margin-block: 18px; }

.formgrid label, .formstack label { display: grid; gap: 5px; min-width: 0; }

.formgrid label > span, .formstack label > span {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.formgrid label > span i, .formstack label > span i {
    font-style: normal;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-3);
}

.formgrid input, .formgrid select, .formgrid textarea,
.formstack input, .formstack select, .formstack textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    font: inherit;
    font-size: 15px;
    color: var(--ink);
}

.formgrid textarea, .formstack textarea { min-height: 66px; resize: vertical; }

.formgrid :is(input, select, textarea):focus,
.formstack :is(input, select, textarea):focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* ── buy form on the product page ────────────────────────────────────────── */

.buy { display: grid; gap: 16px; }

/* The radio is visually replaced by the styled label, but it stays in the
   accessibility tree so keyboard selection keeps working. */
.swatch input, .size input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.swatch, .size { cursor: pointer; transition: border-color .12s, box-shadow .12s; }

.swatch:has(input:checked), .size:has(input:checked) {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-glow);
}

.swatch:has(input:focus-visible), .size:has(input:focus-visible) {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.deposit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--canvas);
    font-size: 14px;
    cursor: pointer;
}

.deposit input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.deposit b { font-weight: 700; }

/* ── sign-in ─────────────────────────────────────────────────────────────── */

.authcard {
    max-width: 420px;
    margin: 34px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 26px;
    box-shadow: var(--shadow);
}

.authcard h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

.authlede { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }

.authcard .btn { width: 100%; }

.authfoot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-block-start: 14px;
    border-block-start: 1px solid var(--line);
}

.otp {
    letter-spacing: .5em;
    font-size: 22px !important;
    font-weight: 700;
    text-align: center;
}

/* ── orders table ────────────────────────────────────────────────────────── */

.tablewrap { overflow-x: auto; }

.otable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }

.otable th {
    text-align: start;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-3);
    padding-block: 8px;
    border-block-end: 1px solid var(--line);
}

.otable td { padding-block: 11px; border-block-end: 1px solid var(--line); }

.otable tr:last-child td { border-block-end: 0; }

.ta-end { text-align: end; }

.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pill.ok { background: #ecfdf3; color: var(--ok); }

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Country code beside the number, not stacked. The select is sized to its
   content so long country names do not squeeze the number field. */
.phonerow {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.phonerow select {
    flex: 0 1 auto;
    width: auto;
    max-width: 46%;
    min-width: 0;
}

.phonerow input {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 380px) {
    .phonerow { flex-direction: column; }
    .phonerow select { max-width: none; }
}

/* ── deposit + measurements ──────────────────────────────────────────────── */

/* Secondary notes inside a buy-box fieldset. */
.depnote {
    display: block;
    margin: 4px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    font-style: normal;
    color: var(--ink-3);
}

.deposit .depnote { color: var(--ink-2); }

/* A saved measurement set reads as a name, so it needs more room than a
   size chip. */
.opt-list.measures { gap: 8px; }

.measure {
    min-width: 0;
    padding: 9px 14px;
    text-align: start;
    font-weight: 600;
}

/* Standalone label above a radio group in the measurement form. */
.fieldlabel {
    display: block;
    margin-block-end: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* The measurements table has many narrow numeric columns. */
.otable td.num, .otable th.ta-end { white-space: nowrap; }

.tips {
    margin: 4px 0 0;
    padding-inline-start: 18px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-2);
}

.tips b { color: var(--ink); }

.summary .tips li + li { margin-block-start: 2px; }

/* ============================================================================
   Account: a settings list, and collapsible orders
   ========================================================================= */

.settings {
    max-width: 620px;
    margin: 20px auto 8px;
    display: grid;
    gap: 16px;
}

/* Grouped rows separated by a gap, the way the app's Settings screen reads. */
.setgroup {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.setrow {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 16px;
    border: 0;
    border-block-start: 1px solid var(--line);
    background: var(--surface);
    text-align: start;
    color: var(--ink);
    font: inherit;
}

.setgroup .setrow:first-child,
.setgroup form:first-child .setrow { border-block-start: 0; }

a.setrow:hover, .setrow.is-button:hover { background: var(--brand-light); }

.seticon { display: grid; place-items: center; color: var(--ink-2); flex: none; }

a.setrow:hover .seticon, .setrow.is-button:hover .seticon { color: var(--brand-dark); }

.settext { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.settext b { font-size: 15px; font-weight: 600; }

.settext i {
    font-style: normal;
    font-size: 13px;
    color: var(--ink-3);
}

.setmeta { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

.setchev { color: var(--ink-3); font-size: 20px; line-height: 1; }

.setrow.is-profile { padding-block: 18px; }
.setrow.is-profile .settext b { font-size: 16px; }

/* ── orders ──────────────────────────────────────────────────────────────── */

.orders { display: grid; gap: 12px; margin-block: 4px 8px; }

.order {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}

.order[open] { border-color: #d3d7e6; box-shadow: var(--shadow); }

.order > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

/* Hide the native disclosure triangle; the chevron stands in for it. */
.order > summary::-webkit-details-marker { display: none; }
.order > summary::marker { content: ""; }

.order > summary:hover { background: var(--brand-light); }

.order-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.order-id { font-size: 15px; font-weight: 700; }

.order-when { font-size: 13px; color: var(--ink-3); }

.order-tail { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.order[open] .setchev { transform: rotate(90deg); }
.order .setchev { transition: transform .15s; }
html[dir="rtl"] .order[open] .setchev { transform: rotate(-90deg); }

.order-body {
    padding: 4px 16px 16px;
    border-block-start: 1px solid var(--line);
    display: grid;
    gap: 16px;
}

.order-items { display: grid; gap: 10px; padding-block-start: 12px; }

.order-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.order-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.order-item-body b { font-size: 14px; font-weight: 600; }

.order-item-meta { font-size: 12.5px; color: var(--ink-3); }

.order-cols { display: grid; gap: 16px; }

@media (min-width: 640px) {
    .order-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
}

.order-cols h3 {
    margin: 0 0 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.order-addr {
    margin: 0 0 8px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--ink-2);
}

.order-addr b { color: var(--ink); }

.order-acts { display: flex; gap: 9px; flex-wrap: wrap; }

.order-acts .btn { min-width: 200px; }

@media (max-width: 520px) {
    .order-acts .btn { width: 100%; min-width: 0; }
}

/* ── status pills ────────────────────────────────────────────────────────────
   Done is green, waiting is amber, on its way is blue. The exact colours are
   the ones DataHelper::getOrderStatus() already uses in the portal, so a
   status reads the same to a customer here as it does to staff there.
   ------------------------------------------------------------------------- */

.pill--green {
    background: #d9fbd0;
    color: #1c6c09;
    border: 1px solid #90d67f;
}

.pill--amber {
    background: #ffefca;
    color: #bc3803;
    border: 1px solid #ffcc85;
}

.pill--blue {
    background: #c7ebff;
    color: #005585;
    border: 1px solid #60c6ff;
}

.pill--grey {
    background: #eff2f6;
    color: #525b75;
    border: 1px solid #cbd0dd;
}

/* The border makes these a pixel taller than the plain gold pill; pull the
   padding in so a row of mixed pills still lines up. */
.pill--green, .pill--amber, .pill--blue, .pill--grey { padding: 2px 8px; }

/* A dot carries the state for anyone who cannot separate the hues. */
.pill--green::before,
.pill--amber::before,
.pill--blue::before,
.pill--grey::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 5px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
}

/* ── product gallery ────────────────────────────────────────────────────────
   Most products carry several images. The strip alone gave no sign of that on
   a desktop, so the picker below is the important part; the arrows are a
   convenience for a mouse and the strip still swipes on a phone.
   ------------------------------------------------------------------------- */

.pdp-media { position: relative; }

/* Each image is its own slide so a thumbnail can target it. */
.pdp-slide {
    position: relative;
    width: 100%;
    height: 100%;
    scroll-snap-align: center;
}

.pdp-slide > img,
.pdp-slide > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pdp-media.is-strip > .pdp-slide { grid-row: 1; }

/* ── arrows ──────────────────────────────────────────────────────────────── */

.pdp-arrow {
    position: absolute;
    inset-block-start: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    padding: 0 0 2px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .16);
    transition: background .15s, border-color .15s;
}

.pdp-arrow:hover { background: #fff; border-color: var(--brand); color: var(--brand-dark); }

.pdp-arrow.is-prev { inset-inline-start: 10px; }
.pdp-arrow.is-next { inset-inline-end: 10px; }

/* The glyphs are literal, so mirror them for Arabic. */
html[dir="rtl"] .pdp-arrow { transform: translateY(-50%) scaleX(-1); }

.pdp-arrow[disabled] { opacity: .35; pointer-events: none; }

/* Only worth showing where there is a pointer to use them. */
@media (hover: none) {
    .pdp-arrow { display: none; }
}

.pdp-count {
    position: absolute;
    inset-block-end: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(12, 10, 6, .66);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* ── the picker ──────────────────────────────────────────────────────────── */

.pdp-thumbs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 62px;
    gap: 8px;
    margin-block-start: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-block-end: 2px;
}

.pdp-thumbs::-webkit-scrollbar { height: 6px; }
.pdp-thumbs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.pdp-thumb {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: var(--brand-light);
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: border-color .15s;
}

.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pdp-thumb:hover { border-color: #d9c48b; }

.pdp-thumb.is-on {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
}

.pdp-thumb:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* A video has no still to show, so it gets a play tile. */
.pdp-thumb.is-video { background: #1c1305; }

.pdp-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
}

@media (min-width: 900px) {
    .pdp-thumbs { grid-auto-columns: 74px; gap: 9px; }
}
