/* ── 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 ── */
.purch-topbar {
  background: #3a0b12; color: #fff; padding: 12px 16px;
  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; }
.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; }

/* ── 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; }
.prod-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.08); text-align: left; }
.prod-card img { width: 100%; height: 100px; object-fit: cover; background: #eee; display: block; }
.prod-card .pc-body { padding: 8px; }
.prod-card .pc-name { font-size: 12.5px; font-weight: 700; color: #4A0E17; }
.prod-card .pc-cat { font-size: 10.5px; color: #888; margin: 2px 0 6px; }

/* ── 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; }
