/* ==========================================================================
   Antibuy — components
   ========================================================================== */

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 15px; }
.divider { height: 1px; background: var(--line); }

.ph { background: var(--sand); border-radius: 14px; overflow: hidden; position: relative; display: grid; place-items: center; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.tall { aspect-ratio: 3 / 4; }
.ph.square { aspect-ratio: 1 / 1; }

/* ---------------------------------------------------------- product cards */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 12px; padding-inline: 16px; }
.pgrid.three { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.pcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pcard .ph { border-radius: 16px; }
.pcard .info { display: flex; flex-direction: column; gap: 2px; }
.pcard .name {
  font-size: 12.5px; font-weight: 600; line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 33px;
}
.pcard .brand { font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pcard .price-line { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.pcard .act { margin-top: 5px; }
.pcard .act .btn-mini { width: 100%; justify-content: center; }
.pcard .fav {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 28px; height: 28px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.pcard .fav svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.pcard .fav.on { color: var(--brand); }
.pcard .fav.on svg { fill: var(--brand); stroke: var(--brand); }
.tagline { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 4px; }
.tag {
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px;
  background: var(--brand); color: #fff;
}
.tag.soft { background: var(--card); color: var(--brand); }
.tag.dark { background: var(--ink); color: var(--paper); }

.price { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.price .cur { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-inline-end: 2px; }
.price-old { font-size: 11px; color: var(--muted); text-decoration: line-through; }
.price-lg { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.discount { font-size: 10px; font-weight: 800; color: var(--brand); }

/* ------------------------------------------------------------------ chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 34px; padding: 0 15px;
  border-radius: 999px;
  border: 1.3px solid var(--line);
  background: var(--card);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .18s;
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.brand.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-sm { height: 28px; padding: 0 11px; font-size: 11.5px; }

/* ------------------------------------------------------------------- hero */
.hero {
  margin: 4px 16px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  color: #fff;
  background: var(--brand);
  min-height: 200px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-3);
  isolation: isolate;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, 0) 58%);
}
.hero .copy { position: relative; z-index: 3; padding: 22px 18px; max-width: 64%; }
.hero .copy h2 {
  font-family: var(--serif);
  font-size: 25px; line-height: 1.1; letter-spacing: -.01em; font-weight: 600;
  text-transform: uppercase;
}
.hero .copy p { margin-top: 7px; font-size: 11px; line-height: 1.45; opacity: .88; max-width: 190px; }
.hero .copy .btn { margin-top: 14px; height: 38px; padding: 0 16px; font-size: 12px; background: var(--paper); color: var(--ink); }
.hero .art { position: absolute; inset-block: 0; inset-inline-end: 0; width: 60%; z-index: 2; }
.hero .art svg { width: 100%; height: 100%; display: block; }
.hero.dark { background: var(--ink); }
.hero.sand { background: var(--sand-2); color: var(--ink); }
.hero.sand::after { background: linear-gradient(100deg, rgba(255, 255, 255, .35), transparent 60%); }
.hero.sand .copy .btn { background: var(--ink); color: var(--paper); }
.hero-wrap { position: relative; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; padding: 0; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slot { flex: 0 0 100%; scroll-snap-align: center; padding: 0 16px; }
.hero-slot .hero { margin: 0; }
.hero-dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.hero-dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--sand-2); transition: all .3s; }
.hero-dots i.on { width: 16px; background: var(--brand); }

/* ------------------------------------------------------------- categories */
.cat-strip { display: flex; gap: 2px; overflow-x: auto; padding: 2px 10px 0; scrollbar-width: none; }
.cat-strip::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 0; }
.cat .ring {
  width: 56px; height: 56px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--sand);
  border: 1px solid var(--sand-2);
  transition: transform .18s, background .18s;
}
.cat:active .ring { transform: scale(.94); }
.cat .ring svg { width: 26px; height: 26px; stroke: var(--ink); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cat span { font-size: 10.5px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2; }
.cat.active .ring { background: var(--brand); border-color: var(--brand); }
.cat.active .ring svg { stroke: #fff; }

/* --------------------------------------------------------------- list rows */
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  width: 100%; text-align: start;
  transition: background .15s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--sand); }
.list-row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.list-row .ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.list-row .chev { color: var(--muted); }
.list-row .chev svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.list-row .t { font-size: 13.5px; font-weight: 600; }
.list-row .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input {
  height: 46px; padding: 0 14px;
  border-radius: 12px;
  border: 1.3px solid var(--line);
  background: var(--card);
  font-size: 14px; width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
textarea.input { height: 84px; padding: 12px 14px; resize: none; }
.input-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px;
  background: var(--card); border: 1.3px solid var(--line);
  border-radius: 999px; flex: 1;
}
.input-search svg { width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 1.9; }
.input-search input { border: 0; background: transparent; flex: 1; font-size: 13px; min-width: 0; outline: none; }

/* ------------------------------------------------------------------- misc */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: var(--sand); color: var(--ink-2); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ok { background: #E4F1E9; color: var(--ok); }
.badge.warn { background: #FBEEDC; color: var(--warn); }
.badge.dark { background: var(--ink); color: var(--paper); }
.badge svg { width: 12px; height: 12px; flex: none; stroke: currentColor; fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty svg { width: 46px; height: 46px; stroke: var(--sand-2); fill: none; stroke-width: 1.4; margin: 0 auto 12px; }
.empty h4 { color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 12.5px; line-height: 1.5; }

.skel { background: linear-gradient(100deg, var(--sand) 30%, var(--sand-2) 50%, var(--sand) 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -120% 0; } }

.toast {
  position: fixed; left: 50%; bottom: 100px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper);
  padding: 11px 18px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .28s cubic-bezier(.2, .9, .3, 1.2);
  z-index: 200; max-width: 86vw; text-align: center;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ sheet */
.sheet-root { position: fixed; inset: 0; pointer-events: none; z-index: 150; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(23, 19, 15, .45); opacity: 0; transition: opacity .28s; }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0;
  margin-inline: auto; max-width: 430px;
  background: var(--card);
  border-radius: 26px 26px 0 0;
  padding: 6px 0 max(18px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2, .9, .25, 1);
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .4);
}
.sheet-root.open { pointer-events: auto; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: translateY(0); }
.sheet .handle { width: 38px; height: 4px; border-radius: 999px; background: var(--sand-2); margin: 6px auto 12px; }
.sheet .sheet-body { padding: 0 18px; }
.sheet h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 10px; }

/* ---------------------------------------------------------------- steppers */
.stepper { display: inline-flex; align-items: center; border: 1.3px solid var(--line); border-radius: 999px; overflow: hidden; height: 34px; }
.stepper button { width: 34px; height: 100%; display: grid; place-items: center; }
.stepper button svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.stepper span { min-width: 30px; text-align: center; font-size: 13px; font-weight: 700; }

.pbar { height: 6px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .5s; }

.switch { width: 42px; height: 25px; border-radius: 999px; background: var(--sand-2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 999px; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(17px); }
[dir="rtl"] .switch.on::after { transform: translateX(-17px); }

.actionbar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 10;
}

/* ------------------------------------------------------------------- stats */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 10.5px; color: var(--muted); font-weight: 600; }
