/* ===========================================================================
   ZALLIXOR MART — components
   =========================================================================== */

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:40px;padding:0 18px;border-radius:var(--r-pill);
  font-size:14px;font-weight:600;white-space:nowrap;
  border:1px solid transparent;transition:background .14s,border-color .14s,color .14s;
}
.btn svg{width:17px;height:17px;flex:none}
.btn-primary{background:var(--zx-violet);color:#fff}
.btn-primary:hover{background:var(--zx-violet-dark)}
.btn-buy{background:var(--zx-deal);color:#fff}
.btn-buy:hover{filter:brightness(.93)}
.btn-ghost{border-color:var(--zx-line);background:var(--zx-surface);color:var(--zx-ink)}
.btn-ghost:hover{border-color:var(--zx-violet);color:var(--zx-violet)}
.btn-quiet{color:var(--zx-violet);padding:0 8px;height:34px}
.btn-quiet:hover{background:var(--zx-violet-wash)}
.btn-danger{border-color:#F2C7C0;background:var(--zx-surface);color:var(--zx-deal)}
.btn-danger:hover{background:var(--zx-deal-wash)}
.btn-sm{height:32px;padding:0 13px;font-size:13px}
.btn-lg{height:48px;padding:0 26px;font-size:15px}
.btn-full{width:100%}
.btn[disabled],.btn[aria-disabled="true"]{opacity:.5;pointer-events:none}
.btn.is-busy{position:relative;color:transparent !important}
.btn.is-busy::after{
  content:"";position:absolute;width:16px;height:16px;border-radius:50%;
  border:2px solid rgba(255,255,255,.4);border-top-color:#fff;animation:spin .6s linear infinite;
}
.btn-ghost.is-busy::after{border-color:var(--zx-line);border-top-color:var(--zx-violet)}
@keyframes spin{to{transform:rotate(360deg)}}

/* ---------- badges ---------- */
.tag{
  display:inline-flex;align-items:center;gap:4px;
  padding:2px 7px;border-radius:var(--r-sm);
  font-size:11px;font-weight:700;line-height:1.6;
}
.tag-deal{background:var(--zx-deal);color:#fff}
.tag-new{background:var(--zx-cyan-wash);color:#0A7A8C}
.tag-free{background:var(--zx-good-wash);color:var(--zx-good)}
.tag-low{background:var(--zx-warn-wash);color:var(--zx-warn)}
.tag-out{background:#EDECF2;color:var(--zx-mute)}
.tag-ver{background:var(--zx-violet-wash);color:var(--zx-violet)}
.tag-spon{background:rgba(255,255,255,.92);color:var(--zx-mute);font-weight:600}

.status{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:var(--r-pill);font-size:12px;font-weight:600}
.status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.status-active,.status-paid,.status-delivered{background:var(--zx-good-wash);color:var(--zx-good)}
.status-draft,.status-cancelled,.status-removed{background:#EDECF2;color:var(--zx-mute)}
.status-pending,.status-pending_review,.status-shipped{background:var(--zx-warn-wash);color:var(--zx-warn)}
.status-out_of_stock,.status-rejected{background:var(--zx-deal-wash);color:var(--zx-deal)}

/* ---------- product grid + card ---------- */
.pgrid{
  display:grid;gap:10px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}
@media(min-width:520px){ .pgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px} }
@media(min-width:820px){ .pgrid{grid-template-columns:repeat(4,minmax(0,1fr))} }
@media(min-width:1120px){ .pgrid{grid-template-columns:repeat(5,minmax(0,1fr))} }
@media(min-width:1340px){ .pgrid{grid-template-columns:repeat(6,minmax(0,1fr))} }

/* Rails scroll sideways at every width — the way shoppers expect a shelf to
   behave — instead of wrapping into a grid with stragglers on a second row. */
.prail{
  display:grid;grid-auto-flow:column;grid-auto-columns:44%;
  gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;
  scrollbar-width:none;padding-bottom:4px;overscroll-behavior-x:contain;
}
.prail::-webkit-scrollbar{display:none}
.prail > *{scroll-snap-align:start}
@media(min-width:520px){ .prail{grid-auto-columns:30%} }
@media(min-width:820px){ .prail{grid-auto-columns:calc((100% - 40px) / 5);gap:10px} }
@media(min-width:1340px){ .prail{grid-auto-columns:calc((100% - 60px) / 7)} }

.pcard{
  background:var(--zx-surface);border-radius:var(--r-md);
  overflow:hidden;display:flex;flex-direction:column;
  position:relative;border:1px solid var(--zx-line-soft);
  transition:border-color .15s,box-shadow .15s;
}
.pcard:hover{border-color:var(--zx-line);box-shadow:var(--shadow-2)}
.pcard-img{
  aspect-ratio:1;background:#F6F5FA;position:relative;overflow:hidden;
}
.pcard-img img{width:100%;height:100%;object-fit:cover;transition:transform .35s ease}
.pcard:hover .pcard-img img{transform:scale(1.035)}
.pcard-flags{position:absolute;top:7px;right:7px;display:flex;flex-direction:column;gap:4px;align-items:flex-end}
.pcard-disc{
  position:absolute;top:0;left:0;background:var(--zx-deal);color:#fff;
  font-size:12px;font-weight:800;padding:4px 8px 4px 7px;border-radius:0 0 var(--r-md) 0;
  letter-spacing:-.01em;
}
.pcard-body{padding:9px 10px 11px;display:flex;flex-direction:column;flex:1}
.pcard-title{
  font-size:13.5px;line-height:1.35;color:var(--zx-body);font-weight:500;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  min-height:36px;
}
.pcard-price{display:flex;align-items:baseline;gap:6px;margin-top:7px;flex-wrap:wrap;padding-right:30px}
.pcard-price b{font-size:17px;font-weight:900;color:var(--zx-ink);letter-spacing:-.03em}
.pcard.is-deal .pcard-price b{color:var(--zx-deal)}
.pcard-price s{font-size:12px;color:var(--zx-faint)}
.pcard-meta{display:flex;align-items:center;gap:5px;margin-top:5px;font-size:12px;color:var(--zx-mute)}
.pcard-store{margin-top:3px;font-size:12px;color:var(--zx-faint);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-right:32px}
.pcard a.pcard-hit{position:absolute;inset:0;z-index:1}
.pcard-add{
  position:absolute;bottom:10px;right:9px;z-index:2;
  width:32px;height:32px;border-radius:50%;background:var(--zx-ink);color:#fff;
  display:grid;place-items:center;
}
.pcard-add svg{width:17px;height:17px}
.pcard-add:hover{background:var(--zx-violet)}
.pcard-add:disabled{opacity:.5}

.stars{display:inline-flex;align-items:center;gap:2px;color:var(--zx-star);font-size:11.5px;font-weight:600}
.stars svg{width:12px;height:12px}

/* ---------- store / category cards ---------- */
.scard{
  background:var(--zx-surface);border-radius:var(--r-md);padding:12px;
  display:flex;gap:10px;align-items:center;box-shadow:var(--shadow-1);
}
.scard-logo{width:44px;height:44px;border-radius:var(--r-md);background:var(--zx-line-soft);flex:none;object-fit:cover}
.scard b{font-size:13.5px;display:block}

.catgrid{display:grid;gap:8px;grid-template-columns:repeat(4,minmax(0,1fr))}
@media(min-width:640px){ .catgrid{grid-template-columns:repeat(6,minmax(0,1fr))} }
@media(min-width:1000px){ .catgrid{grid-template-columns:repeat(12,minmax(0,1fr))} }
.catgrid a{
  background:var(--zx-surface);border-radius:var(--r-md);padding:12px 6px;
  text-align:center;font-size:11.5px;font-weight:500;color:var(--zx-body);
  box-shadow:var(--shadow-1);display:flex;flex-direction:column;align-items:center;gap:7px;
}
.catgrid a:hover{color:var(--zx-violet)}
.catgrid .dot{width:34px;height:34px;border-radius:50%;background:var(--zx-violet-wash);display:grid;place-items:center;color:var(--zx-violet)}
.catgrid .dot svg{width:18px;height:18px}

/* ---------- panels, forms ---------- */
.panel{background:var(--zx-surface);border-radius:var(--r-md);box-shadow:var(--shadow-1)}
.panel-pad{padding:16px}
@media(min-width:760px){ .panel-pad{padding:20px} }
.panel-hd{padding:14px 16px;border-bottom:1px solid var(--zx-line-soft);display:flex;align-items:center;gap:10px}

.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;font-weight:600;color:var(--zx-body);margin-bottom:5px}
.field .help{font-size:12px;color:var(--zx-mute);margin-top:4px}
.field .err{font-size:12px;color:var(--zx-deal);margin-top:4px;font-weight:500}
.input,.select,.textarea{
  width:100%;background:var(--zx-surface);border:1px solid var(--zx-line);
  border-radius:var(--r-sm);padding:0 12px;height:40px;font-size:14px;
}
.textarea{height:auto;padding:10px 12px;resize:vertical;min-height:96px;line-height:1.55}
.select{appearance:none;padding-right:32px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236E6B80' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;background-size:11px}
.input:focus,.select:focus,.textarea:focus{border-color:var(--zx-violet);outline:none;box-shadow:0 0 0 3px var(--zx-violet-wash)}
.input[aria-invalid="true"]{border-color:var(--zx-deal)}
.field-row{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:640px){ .field-row{grid-template-columns:1fr 1fr} }

.check{display:flex;gap:9px;align-items:flex-start;padding:9px 0;font-size:13.5px;cursor:pointer}
.check input{width:17px;height:17px;margin-top:1px;accent-color:var(--zx-violet);flex:none}

/* ---------- quantity ---------- */
.qty{display:inline-flex;align-items:center;border:1px solid var(--zx-line);border-radius:var(--r-pill);overflow:hidden;background:var(--zx-surface)}
.qty button{width:34px;height:34px;display:grid;place-items:center;font-size:17px;color:var(--zx-body)}
.qty button:hover{background:var(--zx-line-soft)}
.qty span{min-width:34px;text-align:center;font-weight:600;font-size:14px}

/* ---------- image uploader ---------- */
.upl{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(92px,1fr))}
.upl-item{position:relative;aspect-ratio:1;border-radius:var(--r-sm);overflow:hidden;background:var(--zx-line-soft)}
.upl-item img{width:100%;height:100%;object-fit:cover}
.upl-item button{
  position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;
  background:rgba(0,0,0,.62);color:#fff;display:grid;place-items:center;font-size:14px;line-height:1;
}
.upl-item .cover{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,.62);color:#fff;font-size:10.5px;text-align:center;padding:2px}
.upl-add{
  aspect-ratio:1;border:1.5px dashed var(--zx-line);border-radius:var(--r-sm);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  color:var(--zx-mute);font-size:11.5px;background:var(--zx-surface);
}
.upl-add:hover{border-color:var(--zx-violet);color:var(--zx-violet)}
.upl-bar{height:3px;background:var(--zx-line-soft);border-radius:2px;overflow:hidden;margin-top:6px}
.upl-bar i{display:block;height:100%;background:var(--zx-violet);width:0;transition:width .2s}

/* ---------- tables ---------- */
.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
.tbl th{
  text-align:left;font-size:12px;font-weight:600;color:var(--zx-mute);
  padding:10px 12px;border-bottom:1px solid var(--zx-line);white-space:nowrap;
}
.tbl td{padding:12px;border-bottom:1px solid var(--zx-line-soft);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl-wrap{overflow-x:auto}
.tbl-thumb{width:40px;height:40px;border-radius:var(--r-sm);object-fit:cover;background:var(--zx-line-soft);flex:none}

/* ---------- states ---------- */
.sk{background:linear-gradient(90deg,#EDECF2 25%,#F6F5FA 37%,#EDECF2 63%);background-size:400% 100%;animation:shim 1.3s ease infinite;border-radius:var(--r-sm)}
@keyframes shim{0%{background-position:100% 50%}100%{background-position:0 50%}}
.sk-card{background:var(--zx-surface);border-radius:var(--r-md);overflow:hidden;box-shadow:var(--shadow-1)}
.sk-card .sk-img{aspect-ratio:1}
.sk-card .sk-line{height:10px;margin:9px}
.sk-card .sk-line.s{width:55%}

.state{
  text-align:center;padding:46px 20px;color:var(--zx-mute);
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.state svg{width:38px;height:38px;color:var(--zx-faint)}
.state b{color:var(--zx-ink);font-size:15px;display:block}
.state p{max-width:38ch;font-size:13.5px}

/* ---------- toast ---------- */
.toasts{position:fixed;left:50%;bottom:80px;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;width:max-content;max-width:92vw}
@media(min-width:760px){ .toasts{bottom:24px;left:auto;right:24px;transform:none} }
.toast{
  background:#22202C;color:#fff;padding:11px 16px;border-radius:var(--r-pill);
  font-size:13.5px;box-shadow:var(--shadow-3);display:flex;align-items:center;gap:9px;
  animation:pop .18s ease;
}
.toast.err{background:var(--zx-deal)}
.toast.ok{background:var(--zx-good)}
@keyframes pop{from{opacity:0;transform:translateY(8px)}}

/* ---------- modal / sheet ---------- */
.scrim{position:fixed;inset:0;background:rgba(22,21,29,.5);z-index:150;opacity:0;pointer-events:none;transition:opacity .18s}
.scrim.on{opacity:1;pointer-events:auto}
.sheet{
  position:fixed;z-index:160;background:var(--zx-surface);
  left:0;right:0;bottom:0;border-radius:var(--r-lg) var(--r-lg) 0 0;
  max-height:86vh;overflow-y:auto;transform:translateY(100%);transition:transform .22s ease;
}
.sheet.on{transform:translateY(0)}
@media(min-width:760px){
  .sheet{left:50%;top:50%;right:auto;bottom:auto;width:min(520px,92vw);border-radius:var(--r-lg);
    transform:translate(-50%,-46%) scale(.97);opacity:0}
  .sheet.on{transform:translate(-50%,-50%) scale(1);opacity:1}
}
.sheet-hd{display:flex;align-items:center;padding:16px;border-bottom:1px solid var(--zx-line-soft)}
.sheet-hd h3{font-size:16px}
.sheet-hd button{margin-left:auto;font-size:24px;line-height:1;color:var(--zx-mute);padding:0 4px}
.sheet-bd{padding:16px}
.sheet-ft{padding:14px 16px;border-top:1px solid var(--zx-line-soft);display:flex;gap:10px}

/* ---------- misc ---------- */
.crumbs{display:flex;gap:6px;align-items:center;font-size:12.5px;color:var(--zx-mute);padding:12px 0;flex-wrap:wrap}
.crumbs a:hover{color:var(--zx-violet)}
.crumbs span{color:var(--zx-faint)}

.chipbar{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.chipbar::-webkit-scrollbar{display:none}
.chip{
  border:1px solid var(--zx-line);background:var(--zx-surface);
  border-radius:var(--r-pill);padding:6px 13px;font-size:13px;white-space:nowrap;color:var(--zx-body);
}
.chip[aria-pressed="true"]{background:var(--zx-violet);border-color:var(--zx-violet);color:#fff;font-weight:600}

.note{
  background:var(--zx-cyan-wash);border-radius:var(--r-sm);padding:11px 13px;
  font-size:12.5px;color:#0A6C7C;display:flex;gap:9px;align-items:flex-start;
}
.note svg{width:16px;height:16px;flex:none;margin-top:1px}
.note-warn{background:var(--zx-warn-wash);color:var(--zx-warn)}

/* ===========================================================================
   CRAFT LAYER
   ---------------------------------------------------------------------------
   The gap between a marketplace that looks built and one that looks assembled
   isn't decoration — it's the handful of details that only show up on a real
   device, on a real connection, with real data in them. Nothing below adds
   ornament. Every rule fixes something a shopper would feel.
   =========================================================================== */

/* Prices in tabular figures. In a grid, proportional digits make every price
   sit at a slightly different width and the column reads ragged; tabular
   figures line the naira up. It's the difference a person notices without
   being able to name it. */
.pcard-price b,.pcard-price s,.price,.tnum,.money{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1,"cv05" 1;
}
.pcard-price b{letter-spacing:-.015em}

/* Long product titles from real sellers break layouts. Sellers write
   "SAMSUNG-GALAXY-A54-256GB-BLACK-BRANDNEW-SEALED" and a card without this
   overflows its own box. */
.pcard-title,.pcard-store{overflow-wrap:anywhere}

/* Images fade in as they decode instead of snapping. On a slow connection the
   snap is the single most obvious sign of a cheap site. The image element
   starts transparent only once it has a src — an empty frame stays as the
   grey placeholder rather than fading in from nothing. */
.pcard-img img{
  opacity:0;
  transition:opacity .25s ease;
}
.pcard-img img[src]{opacity:1}

/* Sold out reads before the label does. A shopper scanning forty cards sees
   the state, then confirms it by reading. */
.pcard:has(.tag-out) .pcard-img img{filter:grayscale(1);opacity:.55}
.pcard:has(.tag-out) .pcard-price b{color:var(--zx-mute)}

/* Keyboard focus. The card is an overlay link, so the ring has to be drawn on
   the card itself or it lands on an invisible element and nobody can see
   where they are. */
.pcard:focus-within{
  box-shadow:0 0 0 2px var(--zx-surface),0 0 0 4px var(--zx-violet);
  border-radius:var(--r-lg);
}
.pcard a.pcard-hit:focus-visible{outline:none}

a:focus-visible,button:focus-visible,input:focus-visible,
select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--zx-violet);
  outline-offset:2px;
  border-radius:var(--r-sm);
}

/* Selecting text picks up the brand rather than the browser's default blue. */
::selection{background:var(--zx-violet);color:#fff}

/* Tapping shouldn't flash a grey box on Android. */
a,button{-webkit-tap-highlight-color:transparent}

/* Headline wrapping: `balance` stops a two-line heading leaving one orphaned
   word on the second line. */
h1,h2,h3{text-wrap:balance}

/* Anyone who has asked their device to stop animating gets no animation. Not
   a reduced one — none. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
  .pcard-img img{opacity:1}
}


/* ---------- sponsored units ----------------------------------------------
   Deliberately the same weight as a product card. An ad that shouts is an ad
   people learn to skip; an ad that hides is one they feel tricked by. The
   label carries the honesty, not the styling. */
.adunit{position:relative;display:flex;flex-direction:column;border:1px solid var(--zx-line);
  border-radius:14px;overflow:hidden;background:var(--zx-surface)}
.adunit-hit{position:absolute;inset:0;z-index:2}
.adunit-media{position:relative;aspect-ratio:16/9;background:var(--zx-tint);
  display:grid;place-items:center;overflow:hidden}
.adunit-media img{width:100%;height:100%;object-fit:cover}
/* Opaque, not translucent. The badge sits on artwork an advertiser controls,
   so it cannot depend on what is behind it for contrast. */
.adunit-badge{position:absolute;top:8px;left:8px;z-index:1;
  background:#111;color:#fff;font-size:11px;font-weight:700;letter-spacing:.04em;
  padding:3px 7px;border-radius:5px;line-height:1.2;
  box-shadow:0 1px 3px rgba(0,0,0,.35)}

/* The row an uploaded image cannot reach. */
.adunit-label{font-size:11px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--zx-faint)}
.adunit-body{padding:11px 12px 13px;display:flex;flex-direction:column;gap:5px}
.adunit-title{font-weight:650;font-size:14px;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.adunit-sub{font-size:12.5px;color:var(--zx-mute);line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.adunit-cta{margin-top:2px;font-size:12.5px;font-weight:650;color:var(--zx-brand)}

/* A sponsored rail sits apart from editorial rows so the boundary is obvious. */
.adrail{display:grid;gap:12px}
@media (min-width:640px){.adrail{grid-template-columns:repeat(2,1fr)}}
.adslot-label{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--zx-faint);margin-bottom:8px}

/* ---------- category glyph ---------- */
.cat-ico{
  --tint:var(--zx-violet);
  width:46px;height:46px;border-radius:50%;flex:none;display:grid;place-items:center;
  color:var(--tint);background:color-mix(in srgb,var(--tint) 12%,#fff);
}
.cat-ico svg{width:23px;height:23px}
.scard-logo svg{width:24px;height:24px}
.scard b{display:flex;align-items:center;gap:6px;flex-wrap:wrap}

/* x icon inside close / remove buttons (replaces the old &times; glyph) */
.upl-item button svg{width:12px;height:12px}
.sheet-hd button svg,.modal-hd button svg{width:20px;height:20px}
button[aria-label^="Remove"] svg,button[aria-label="Close"] svg{flex:none}
