/* ── purchase-shared.css — shared across all Purchase module pages ──
   Follows the same look as common.css (maroon #4A0E17 / cream #F5EBE6)
   so Purchase pages feel like one app with the rest of the portal. */

* { box-sizing: border-box; }
body.purch-body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0; padding: 0;
  background-color: #4A0E17; color: #333; min-height: 100vh;
}
.purch-wrap { max-width: 760px; margin: 0 auto; padding: 16px; }

/* ── Top bar with role name + single ordered menu ──
   FIX 2026-09-16: padding matched exactly to the rest of the app's
   .panel-heading box (portal-shared.css — 12px 18px, and 10px 14px on
   phones), so this header looks the same size/spacing as every other
   page's heading bar, not just a similar color. */
.purch-topbar {
  background: #3a0b12; color: #fff; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.purch-topbar .brand { font-weight: 800; letter-spacing: 0.5px; font-size: 15px; }
.purch-topbar .who { font-size: 12px; color: #e8c9ce; }
@media (max-width: 600px) {
  .purch-topbar { padding: 10px 14px; }
}
.purch-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px;
  background: #4A0E17; border-bottom: 3px solid #d4a017;
}
.purch-nav a {
  flex: none; text-decoration: none; color: #f5ebe6; background: rgba(255,255,255,0.08);
  padding: 8px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.purch-nav a.active { background: #fff; color: #4A0E17; }
.purch-nav a.nav-icon-only { margin-left: auto; padding: 8px 12px; font-size: 15px; }

/* ── ADDED 2026-09-15 — integrated header menu (Radhakrishnan's request:
   remove the separate menu bar, move Shop/Cart/Orders into the header's
   right side; move "Signed in" next to the brand on the left).
   IMPORTANT: this only takes effect when a page nests .purch-nav INSIDE
   .purch-topbar (new markup — done so far on Purchase-Buyer.html,
   Purchase-Buyer-Cart.html, Purchase-Buyer-Orders.html,
   Purchase-Buyer-Costume.html). A page that still has .purch-nav as a
   separate bar BELOW .purch-topbar (old markup — the Supplier/HOD pages,
   not updated this round since those files weren't provided) is
   untouched by these rules and keeps the original stacked-bar look from
   the plain .purch-nav rule above. Nothing here removes or changes that
   original rule — this only adds a MORE SPECIFIC rule for the new,
   nested case. ── */
.purch-topbar-left { display: flex; align-items: center; gap: 8px; }
.purch-topbar .purch-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 0;
  background: none; border-bottom: none; margin-left: auto;
}
/* FIX 2026-09-16 (Radhakrishnan's report): the non-selected tabs
   (rgba(255,255,255,0.14) on the same dark header background) were
   nearly invisible — you could only tell there was a menu there by
   reading the text, not by seeing tab shapes. Selected tab (white)
   already stood out fine. Gave the non-selected tabs a visibly
   brighter fill plus a light border, so all the tabs read as buttons
   at a glance, not just the selected one. */
.purch-topbar .purch-nav a {
  flex: none; text-decoration: none; color: #fff; background: rgba(255,255,255,0.24);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 10px; border-radius: 16px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.purch-topbar .purch-nav a.active { background: #fff; color: #4A0E17; border-color: #fff; }
.purch-topbar .purch-nav a.nav-icon-only { margin-left: 0; padding: 6px 10px; font-size: 13px; }
@media (max-width: 480px) {
  .purch-topbar .purch-nav { width: 100%; margin-left: 0; }
}

/* ── Page container ── */
.purch-card { background: #F5EBE6; border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); margin-bottom: 16px; }
.purch-card h1 { color: #4A0E17; font-size: 19px; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 6px; }
.purch-card .sub { text-align: center; color: #7a5c00; font-size: 12.5px; margin-bottom: 16px; }

/* ── Panels / list rows / tables ── */
.panel { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); margin-bottom: 14px; }
.panel h3 { color: #4A0E17; font-size: 14.5px; margin: 0 0 10px; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid #f0ece5; }
.row-item:last-child { border-bottom: none; }
.row-item img.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: #eee; flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; color: #4A0E17; font-size: 14px; }
.row-sub { font-size: 12px; color: #666; margin-top: 2px; }

/* ── Buttons ── */
.btn { border: none; border-radius: 8px; padding: 10px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.btn-primary { background: #4A0E17; color: #fff; }
.btn-primary:hover { background: #63131e; }
.btn-secondary { background: #eee; color: #444; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-success { background: #2ecc71; color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Forms ── */
.field { margin-bottom: 12px; text-align: left; }
.field label { display: block; font-weight: 700; color: #555; font-size: 12.5px; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; color: #333;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #4A0E17; outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Status pills ── */
.pill { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.pill-pending { background: #fff3cd; color: #7a5c00; }
.pill-priced { background: #d6e4ff; color: #1a3e8c; }
.pill-paid { background: #d4edda; color: #1e6b34; }
.pill-processing { background: #e0d0db; color: #4A0E17; }
.pill-shipped { background: #cfe8f3; color: #0d5b73; }
.pill-delivered { background: #d4edda; color: #1e6b34; }
.pill-cancelled { background: #f8d7da; color: #842029; }

/* ── Filters / tabs ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip { padding: 7px 14px; border-radius: 20px; border: 1.5px solid #4A0E17; background: #fff; color: #4A0E17; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.filter-chip.active { background: #4A0E17; color: #fff; }
.tab-row { display: flex; gap: 8px; margin-bottom: 14px; }
.tab-btn { flex: 1; padding: 10px; border-radius: 8px; border: 2px solid #4A0E17; background: #fff; color: #4A0E17; font-weight: 700; font-size: 12.5px; cursor: pointer; text-align: center; }
.tab-btn.active { background: #4A0E17; color: #fff; }

/* ── Product grid (Shop page) ── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; align-items: stretch; }
.prod-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.08); text-align: left; display: flex; flex-direction: column; height: 100%; }
.prod-card img { width: 100%; height: 100px; object-fit: cover; background: #eee; display: block; cursor: zoom-in; }
.prod-card .pc-body { padding: 8px; display: flex; flex-direction: column; flex: 1; }
/* CHANGED 2026-09-17 — title now always reserves 2 lines of space (short
   titles just leave the 2nd line blank; long ones truncate with … at the
   end of line 2) so every card's title block is the same height, and
   everything below it (category/art line, price, +/-) then always starts
   at the same spot across all cards in a row. */
.prod-card .pc-name {
  font-size: 12.5px; font-weight: 700; color: #4A0E17;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3em; min-height: 2.6em;
}
.prod-card .pc-desc { font-size: 11px; color: #666; margin-top: 2px; }
/* CHANGED 2026-09-17 — everything from the category/art line down (price,
   +/- control, running total) is grouped in this one block and pushed to
   the very bottom of the card with margin-top:auto. Combined with the grid
   row stretching every card in a row to the same height, this is what
   makes the +/- row and price line up evenly across all products,
   regardless of how long any one title or description is. */
.pc-bottom { margin-top: auto; padding-top: 6px; }
/* CHANGED 2026-09-17 — Category/Art-Type line is now a single line that
   truncates with … instead of wrapping to 2-3 lines when a product has
   several Art Types. Full, untruncated text still shows on hover/long-
   press via the title attribute set in the page's own script. */
.prod-card .pc-cat {
  font-size: 10.5px; color: #888; margin: 2px 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prod-card .pc-price { font-size: 14px; font-weight: 700; color: #4A0E17; margin-top: 4px; }
.prod-card .pc-price-tbd { font-size: 11px; font-weight: 400; color: #999; margin-top: 4px; }
/* ADDED 2026-09-17 — running-total line now gets its own highlighted
   background while it's showing (qty > 0), so the calculated amount is
   easy to spot at a glance. It already disappears completely at qty 0
   (display:none, unchanged) — this only styles it while visible. */
.prod-card .pc-subtotal {
  font-size: 12px; font-weight: 700; color: #8a5a12; margin-top: 6px;
  background: #fff3cd; border: 1px solid #e8c97a; border-radius: 6px;
  padding: 4px 8px; display: inline-block;
}
/* ADDED 2026-09-17 — glowing highlighted border around the whole card once
   any quantity is selected on it (qty > 0), so a buyer can see at a glance
   which products they've already added. */
.prod-card.selected {
  border: 2px solid #C9A24B;
  box-shadow: 0 0 5px rgba(201,162,75,0.7), 0 0 16px rgba(201,162,75,0.55);
}
/* ADDED 2026-09-17 — full-screen image zoom, opened by tapping a product
   photo. */
.img-zoom-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 9998; align-items: center; justify-content: center; padding: 24px;
  cursor: zoom-out;
}
.img-zoom-overlay.show { display: flex; }
.img-zoom-overlay img {
  max-width: 100%; max-height: 100%; border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* ── Notices / disclaimers ── */
.notice { background: #fff8e8; border: 1px solid #e8c97a; border-radius: 8px; padding: 12px 14px; font-size: 12.5px; color: #7a5c00; margin-bottom: 14px; }
.notice.danger { background: #fdecea; border-color: #f1a9a0; color: #842029; }
.notice strong { display: block; margin-bottom: 3px; }
.msg { font-size: 13px; margin-top: 10px; min-height: 16px; }
.msg.error { color: #c0392b; } .msg.ok { color: #2e7d32; }
.empty-note { text-align: center; color: #888; font-size: 13px; padding: 24px 10px; }

/* ── Reminder / coming soon banner ── */
.coming-soon-banner {
  background: #fff3cd; border: 2px dashed #d4a017; border-radius: 10px; padding: 16px;
  text-align: center; color: #7a5c00; font-weight: 700; font-size: 13px; margin-bottom: 14px;
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ── Compact / tight-list styling (Orders, Payments, History) ── */
.order-group { margin-bottom: 16px; }
.order-group:last-child { margin-bottom: 0; }
.order-group-head { font-weight: 800; color: #4A0E17; font-size: 12.5px; margin-bottom: 3px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tight-row {
  padding: 3px 0; border-bottom: none; font-size: 12.5px; line-height: 1.35;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.tight-row .tr-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.tab-count {
  background: #c0392b; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 10px;
  font-weight: 800; margin-left: 5px; display: inline-block; min-width: 14px; text-align: center;
}
.tab-btn.active .tab-count { background: #c0392b; color: #fff; }
.purch-wrap.wide { max-width: 1100px; }
.status-tag-grey {
  background: #e9e5e0; color: #666; font-size: 9.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 8px; white-space: nowrap; flex-shrink: 0;
}

/* ── Compact multi-column tables (Review Pricing, Payments) ── */
.compact-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compact-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.compact-table th {
  text-align: left; font-size: 9.5px; color: #999; font-weight: 800; text-transform: uppercase;
  padding: 4px 8px; border-bottom: 2px solid #eee; white-space: nowrap;
}
.compact-table td { padding: 4px 8px; border-bottom: 1px solid #f5f0ea; white-space: nowrap; }
.compact-table td input[type=number] {
  width: 55px; padding: 3px 5px; border: 1px solid #ccc; border-radius: 4px; font-size: 11px; text-align: center;
}
.compact-table td input.invalid { border-color: #c0392b; background: #fdecea; }
.compact-table tr.invalid-row td { background: #fdecea; }
.row-warning { color: #c0392b; font-weight: 800; font-size: 10px; }

/* ── Floating draggable Back button — customer-facing Purchase pages ── */
.float-back-btn {
  position: fixed; z-index: 999; width: 46px; height: 46px; border-radius: 50%;
  background: #4A0E17; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  cursor: grab; user-select: none; touch-action: none;
  right: 16px; bottom: 16px; border: 2px solid rgba(255,255,255,0.25);
}
.float-back-btn:active { cursor: grabbing; }
