/* ============================================================
   LAYERONE PRINT  ·  style.css
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --success:     #10b981;
  --danger:      #ef4444;
  --warn:        #f59e0b;

  --radius:    10px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  --sans: 'Inter', sans-serif;
  --mono: 'Space Mono', monospace;

  --speed: .17s;
  --ease:  ease;
}

/* ── Light theme (default) ─────────────────────────────────── */
[data-theme="light"] {
  --bg:      #f8fafc;
  --surface: #ffffff;
  --card:    #ffffff;
  --border:  #e2e8f0;
  --border2: #cbd5e1;
  --tx:      #0f172a;
  --tx2:     #475569;
  --tx3:     #94a3b8;
  --overlay: rgba(255,255,255,.95);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
  --shadow:    0 2px 8px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
}

/* ── Dark theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:      #0f172a;
  --surface: #1e293b;
  --card:    #1e293b;
  --border:  #334155;
  --border2: #475569;
  --tx:      #f1f5f9;
  --tx2:     #94a3b8;
  --tx3:     #64748b;
  --overlay: rgba(15,23,42,.96);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3),  0 2px 8px rgba(0,0,0,.2);
  --shadow:    0 2px 8px rgba(0,0,0,.35), 0 4px 20px rgba(0,0,0,.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  padding-bottom: 90px;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  height: 64px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}

/* Logo — two rows offset like stacked print layers */
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.logo-l1 {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .05em;
  transform: translateX(4px);
  display: block;
}
.logo-l2 {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .05em;
  transform: translateX(-4px);
  margin-top: -2px;
  display: block;
  transition: color var(--speed) var(--ease);
}
.logo-sub {
  font-size: .55rem;
  font-weight: 600;
  color: var(--tx3);
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
  transition: color var(--speed) var(--ease);
}

.header-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* theme toggle button */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--tx2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color var(--speed) var(--ease),
              color var(--speed) var(--ease),
              background var(--speed) var(--ease);
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* admin button + notification dot */
.admin-btn-wrap {
  position: relative;
  display: inline-flex;
}
.new-orders-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 20px;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--overlay);
  pointer-events: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  padding: .6rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--speed) var(--ease);
}
.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary  { background: var(--accent);  color: #fff; border-color: var(--accent); }
.btn-primary:hover  { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-outline  { background: transparent; color: var(--tx);  border-color: var(--border); }
.btn-outline:hover  { border-color: var(--accent); color: var(--accent); }

.btn-ghost    { background: transparent; color: var(--tx2); border-color: transparent; }
.btn-ghost:hover    { background: var(--bg); color: var(--tx); }

.btn-danger   { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover   { filter: brightness(1.1); }

.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover  { filter: brightness(1.05); }

.btn-warn     { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn-warn:hover     { filter: brightness(1.05); }

.btn-sm  { padding: .38rem .75rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: 1rem; }

/* ============================================================
   VIEWS
   ============================================================ */
.view         { display: none; }
.view.active  { display: block; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================================
   FORM PRIMITIVES
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.field label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--tx2);
  letter-spacing: .04em;
}

.inp {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--tx);
  font-family: var(--sans);
  font-size: .875rem;
  padding: .52rem .75rem;
  border-radius: var(--radius-sm);
  outline: none;
  appearance: none;
  transition: border-color var(--speed) var(--ease),
              box-shadow   var(--speed) var(--ease),
              background   var(--speed) var(--ease);
}
.inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[data-theme="dark"] .inp:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,.22);
}
.inp:disabled { opacity: .45; cursor: not-allowed; }
textarea.inp  { resize: vertical; min-height: 80px; }
.color-inp    { padding: 2px 4px; height: 42px; cursor: pointer; }

/* grid helpers */
.form-grid    { display: grid; gap: .75rem; }
.g2           { grid-template-columns: 1fr 1fr; }
.g3           { grid-template-columns: 1fr 1fr 1fr; }
.form-col     { display: flex; flex-direction: column; gap: .75rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1.5rem; }
.form-error   { font-size: .8rem; color: var(--danger); min-height: 1.1rem; margin-top: .25rem; }

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.eyebrow {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
}
.page-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.22;
  margin-bottom: .5rem;
}
.page-sub {
  color: var(--tx2);
  font-size: .93rem;
  margin-bottom: 2rem;
}
.section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx2);
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: 1rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: .6rem;
}
.hero-accent { color: var(--accent); }
.hero-sub    { color: var(--tx2); font-size: .95rem; max-width: 500px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--tx3);
  font-size: .9rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* ============================================================
   PRODUCT CARDS (shop)
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--speed) var(--ease),
              box-shadow   var(--speed) var(--ease),
              transform    var(--speed) var(--ease),
              background   var(--speed) var(--ease);
}
.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: block;
}
.product-img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--tx3);
  font-size: .8rem;
}
.product-img-placeholder svg { opacity: .3; }

.product-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-body h3  { font-size: 1rem; font-weight: 600; margin-bottom: .2rem; }
.product-card-desc     { font-size: .82rem; color: var(--tx2); margin-bottom: .9rem; }

.product-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .71rem;
  font-weight: 500;
  padding: .22rem .55rem;
  border-radius: 20px;
  background: var(--bg);
  color: var(--tx2);
  border: 1px solid var(--border);
}

.field-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--tx2);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .35rem;
  display: block;
}
.field-wrap { margin-bottom: .85rem; }

/* price display on product card */
.price-display {
  margin-bottom: .9rem;
  min-height: 2.6rem;
}
.price-main {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.price-breakdown {
  font-size: .72rem;
  color: var(--tx3);
  margin-top: .15rem;
}

.card-spacer { flex: 1; }

/* ============================================================
   CART BAR (fixed bottom strip)
   ============================================================ */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(0,0,0,.1);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.cart-bar.visible { transform: translateY(0); }

.cart-bar-left { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cart-label    { font-size: .85rem; color: var(--tx2); }
.cart-count    { background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 20px; }
.cart-total    { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--tx); }

/* ============================================================
   REVIEW / CHECKOUT
   ============================================================ */
.review-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .6rem;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.review-line h4 { font-size: .93rem; font-weight: 600; margin-bottom: .15rem; }
.review-line p  { font-size: .78rem; color: var(--tx2); }
.review-line-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.review-line-thumb { width: 52px; height: 39px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); flex-shrink: 0; }
.review-line-price { font-family: var(--mono); font-size: .95rem; font-weight: 700; color: var(--accent); }

.review-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--mono);
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.checkout-form { margin-bottom: 1.5rem; }

/* ============================================================
   SUCCESS VIEW
   ============================================================ */
.success-wrap {
  max-width: 420px;
  margin: 5rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.success-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
}
.success-wrap h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: .75rem; }
.success-wrap p  { color: var(--tx2); font-size: .93rem; line-height: 1.7; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.modal-box.modal-wide   { max-width: 560px; }
.modal-box.modal-scroll { max-height: 90vh; overflow-y: auto; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tx3);
  font-size: 1.1rem;
  padding: .1rem .3rem;
  border-radius: var(--radius-xs);
  transition: color var(--speed) var(--ease);
  line-height: 1;
}
.modal-close-btn:hover { color: var(--tx); }
.modal-sub    { font-size: .85rem; color: var(--tx2); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ============================================================
   IMAGE UPLOAD ZONE
   ============================================================ */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--speed) var(--ease),
              background   var(--speed) var(--ease);
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.drag {
  background: rgba(37,99,235,.1);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 1.8rem; margin-bottom: .4rem; display: block; }
.upload-zone p     { font-size: .8rem; color: var(--tx2); }
.upload-zone small { font-size: .71rem; color: var(--tx3); }

.upload-preview-wrap {
  position: relative;
  display: inline-block;
  margin-top: .75rem;
}
.upload-preview-wrap img {
  width: 130px;
  height: 98px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}
.remove-img-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* The preview img goes inside .upload-preview-wrap which is inside the zone */
#add-upload-preview .upload-preview-wrap,
#edit-upload-preview .upload-preview-wrap {
  display: inline-block;
}

/* ============================================================
   ADMIN SHELL
   ============================================================ */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.admin-header h2 { font-size: 1.2rem; font-weight: 700; }
.admin-header-actions { display: flex; gap: .5rem; }

/* main tab bar */
.tab-bar {
  display: flex;
  gap: .25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 1.75rem;
  overflow-x: auto;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.tab-btn {
  flex: 1;
  min-width: max-content;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  padding: .48rem 1rem;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--tx2);
  cursor: pointer;
  transition: all var(--speed) var(--ease);
  white-space: nowrap;
}
.tab-btn.active { background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm); }

/* tab panels */
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* admin cards (add-form containers) */
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.admin-card h3 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx2);
  margin-bottom: 1.1rem;
}
.card-hint { font-size: .83rem; color: var(--tx2); margin-bottom: 1rem; }

/* ============================================================
   LIST ITEMS (product / material rows in admin)
   ============================================================ */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  transition: border-color var(--speed) var(--ease),
              background   var(--speed) var(--ease);
}
.list-item:hover { border-color: var(--border2); }

.list-item-thumb {
  width: 52px;
  height: 39px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.list-item-thumb-ph {
  width: 52px;
  height: 39px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--tx3);
}
.list-item-info { flex: 1; min-width: 0; }
.list-item-info strong {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-info small { font-size: .75rem; color: var(--tx2); }
.list-item-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* colour dot */
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  border: 1px solid rgba(0,0,0,.12);
}
[data-theme="dark"] .color-dot { border-color: rgba(255,255,255,.12); }

/* material grouped list */
.material-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  overflow: hidden;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.material-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.material-group-header strong { font-size: .88rem; font-weight: 600; }
.material-group-header small  { font-size: .75rem; color: var(--tx2); }
.material-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.material-row:last-child { border-bottom: none; }
.material-row-info { display: flex; align-items: center; gap: .4rem; font-size: .83rem; flex-wrap: wrap; }

/* stock badges */
.stock-badge { font-size: .69rem; font-weight: 600; padding: .15rem .45rem; border-radius: 20px; }
.stock-in    { background: #d1fae5; color: #065f46; }
.stock-low   { background: #fef3c7; color: #92400e; }
.stock-out   { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .stock-in  { background: rgba(16,185,129,.15); color: #6ee7b7; }
[data-theme="dark"] .stock-low { background: rgba(245,158,11,.15);  color: #fcd34d; }
[data-theme="dark"] .stock-out { background: rgba(239,68,68,.15);   color: #fca5a5; }

/* ============================================================
   ORDERS (admin)
   ============================================================ */
.order-sub-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.otab {
  font-family: var(--sans);
  font-size: .83rem;
  font-weight: 600;
  padding: .5rem 1rem;
  border: none;
  background: transparent;
  color: var(--tx2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
  display: flex;
  align-items: center;
  gap: .35rem;
}
.otab:hover  { color: var(--tx); }
.otab.active { color: var(--accent); border-bottom-color: var(--accent); }

.otab-count {
  font-size: .67rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 1.2rem;
  text-align: center;
  transition: background var(--speed) var(--ease),
              border-color var(--speed) var(--ease),
              color var(--speed) var(--ease);
}
.otab.active .otab-count {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="dark"] .otab.active .otab-count { background: rgba(37,99,235,.2); }

/* order row (clickable) */
.order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease),
              box-shadow   var(--speed) var(--ease),
              background   var(--speed) var(--ease);
}
.order-row:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }

.order-row-left  { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.order-row-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.order-row-info  { display: flex; flex-direction: column; min-width: 0; }
.order-row-info strong {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-row-info span { font-size: .77rem; color: var(--tx2); }
.order-row-date     { font-size: .74rem; color: var(--tx3); }
.order-row-chevron  { font-size: 1.2rem; color: var(--tx3); }

/* status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .74rem;
  font-weight: 600;
  padding: .22rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.status-new      { background: #dbeafe; color: #1e40af; }
.status-progress { background: #fef3c7; color: #92400e; }
.status-done     { background: #d1fae5; color: #065f46; }
[data-theme="dark"] .status-new      { background: rgba(37,99,235,.18);  color: #93c5fd; }
[data-theme="dark"] .status-progress { background: rgba(245,158,11,.18); color: #fcd34d; }
[data-theme="dark"] .status-done     { background: rgba(16,185,129,.18); color: #6ee7b7; }

/* ============================================================
   ORDER DETAIL MODAL
   ============================================================ */
.order-modal-date { font-size: .77rem; color: var(--tx2); margin-top: .2rem; }

.od-section       { margin-bottom: 1.5rem; }
.od-section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tx2);
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: .75rem;
}
.od-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .3rem 0;
  font-size: .875rem;
}
.od-row span   { color: var(--tx2); flex-shrink: 0; }
.od-row strong { text-align: right; }

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 0;
  border-top: 2px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--mono);
  margin-top: .5rem;
}
.od-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 80px;
  right: 1.5rem;
  background: var(--tx);
  color: var(--card);
  font-size: .82rem;
  font-weight: 500;
  padding: .65rem 1.1rem;
  border-radius: var(--radius-sm);
  z-index: 999;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 3rem);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  #site-header   { padding: 0 1rem; }
  .hero          { padding: 2rem 1rem 1.5rem; }
  .page,
  .page-narrow   { padding: 1.5rem 1rem; }
  .products-grid { grid-template-columns: 1fr; }
  .g2, .g3       { grid-template-columns: 1fr; }
  .cart-bar      { padding: 0 1rem; }
  .order-row-date { display: none; }
  .logo-l1, .logo-l2 { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
}
