/* ============================================================
   Agent storefront theme — deliberately its own design system,
   independent of the main ASBData site's stylesheet. Two CSS
   variables (--brand-1 / --brand-2) drive the whole thing; they're
   set inline by store.js from the agent's own colors, with safe
   defaults below in case that hasn't run yet.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --brand-1: #29B6E8;
  --brand-2: #2A2FA0;
  --ink: #14181F;
  --muted: #6B7380;
  --line: #E6E8EC;
  --bg: #FAFAFB;
  --card: #FFFFFF;
  --radius: 10px;
  --font-head: 'Sora', sans-serif;
  --font-body: 'Manrope', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- Top bar: flat brand-color strip, not a gradient hero ---- */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 10px 0;
  font-size: .82rem;
  text-align: center;
}
.storebar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.storebar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.store-id { display: flex; align-items: center; gap: 12px; }
.store-id img { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.store-id .name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.store-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: .88rem;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--brand-2); color: #fff; }
.btn-solid:hover { opacity: .9; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--brand-2); color: var(--brand-2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.btn .spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-outline .spinner { border-color: rgba(0,0,0,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Banner: bold flat block instead of a soft gradient hero ---- */
.banner {
  background: var(--brand-2);
  color: #fff;
  padding: 46px 0 54px;
}
.banner h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 640px; }
.banner p { margin: 12px 0 0; opacity: .88; max-width: 520px; font-size: 1rem; }
.banner .tag {
  display: inline-block; background: var(--brand-1); color: #0b0f14;
  font-weight: 700; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 100px; margin-bottom: 14px;
}

/* ---- Shop section ---- */
.shop { padding: 40px 0 70px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.net-tabs { display: flex; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.net-tab {
  border: none; background: none; padding: 9px 16px; border-radius: 7px; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: .85rem; color: var(--muted);
}
.net-tab.active { background: var(--ink); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; position: relative; overflow: hidden; border-top: 4px solid var(--brand-1);
}
.item .size { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; }
.item .validity { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.item .price { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin: 14px 0 12px; color: var(--brand-2); }
.item .buy { width: 100%; }

.loading-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 30px 0; grid-column: 1/-1; justify-content: center; }
.loading-row .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand-2); animation: spin .7s linear infinite; }

/* ---- Footer: agent info only, nothing else ---- */
.store-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .82rem; text-align: center; }

/* ---- Modals ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(20,24,31,.55); display: none;
  align-items: center; justify-content: center; padding: 16px; z-index: 100;
}
.overlay.open { display: flex; }
.sheet {
  background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto; position: relative;
}
.sheet-close {
  position: absolute; top: 14px; right: 14px; background: var(--bg); border: none; width: 30px; height: 30px;
  border-radius: 50%; font-size: 1.1rem; cursor: pointer; color: var(--muted);
}
.sheet h3 { font-size: 1.15rem; margin-bottom: 4px; }
.sheet .sub { color: var(--muted); font-size: .85rem; margin: 0 0 18px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border-radius: 8px; border: 1.5px solid var(--line);
  font-family: var(--font-body); font-size: .92rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand-2); }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

.summary-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.summary-row select { border: none; background: none; font-weight: 700; }
.total-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px dashed var(--line); margin: 10px 0 16px; font-family: var(--font-head); font-weight: 700; }
.warn { font-size: .78rem; color: #9A5B00; background: #FFF6E5; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }
.confirm-rows .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .88rem; border-bottom: 1px solid var(--line); }
.actions-row { display: flex; gap: 10px; margin-top: 6px; }

.msg { display: none; padding: 10px 12px; border-radius: 8px; font-size: .84rem; margin-bottom: 14px; }
.msg.show { display: block; }
.msg.success { background: #E9F9EF; color: #12703A; }
.msg.error { background: #FDEDEE; color: #A32131; }
.form-foot { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 16px; }
.form-foot a { color: var(--brand-2); font-weight: 700; }

/* ---- Simple, non-tabbed customer dashboard (store/dashboard.html) ---- */
.dash-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.dash-grid { display: grid; gap: 18px; margin-bottom: 30px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h3 { font-size: 1.05rem; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: .84rem; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--muted); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: .74rem; font-weight: 700; }
.pill-green { background: #E9F9EF; color: #12703A; }
.pill-amber { background: #FFF6E5; color: #9A5B00; }
.pill-red { background: #FDEDEE; color: #A32131; }
.pill-gray { background: #F1F2F4; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

@media (max-width: 640px) {
  .storebar-inner .store-actions .btn span.label { display: none; }
}
