/* ============================================================
   BSG Payment Calculator – Stylesheet
   Scoped under .bsg-wrap to avoid theme conflicts
   ============================================================ */

.bsg-wrap {
  --bsg-navy:        #1a3c6e;
  --bsg-navy-dark:   #0f2548;
  --bsg-navy-light:  #2a5298;
  --bsg-gold:        #c9a84c;
  --bsg-gold-light:  #e8c96a;
  --bsg-red:         #c0392b;
  --bsg-bg:          #f4f6fb;
  --bsg-white:       #ffffff;
  --bsg-border:      #d6dff0;
  --bsg-text:        #1a2740;
  --bsg-muted:       #5a6e8a;
  --bsg-row-alt:     #f0f4fb;
  --bsg-bk-bg:       #fff8e6;
  --bsg-bk-border:   #f0c040;
  --bsg-dp-bg:       #eaf4ff;
  --bsg-dp-border:   #90bce8;
  font-family: 'Be Vietnam Pro', sans-serif;
  color: var(--bsg-text);
  box-sizing: border-box;
}

.bsg-wrap *, .bsg-wrap *::before, .bsg-wrap *::after {
  box-sizing: inherit;
}

/* ─── HEADER ─── */
.bsg-header {
  background: linear-gradient(135deg, var(--bsg-navy-dark) 0%, var(--bsg-navy) 60%, var(--bsg-navy-light) 100%);
  padding: 28px 32px 24px;
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
.bsg-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.bsg-header-inner { position: relative; z-index: 1; }
.bsg-header-logo  { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.bsg-logo-icon {
  width: 44px; height: 44px;
  background: var(--bsg-gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--bsg-navy-dark);
  flex-shrink: 0;
}
.bsg-brand    { color: #fff; font-size: 13px; font-weight: 500; opacity: .85; letter-spacing: .04em; text-transform: uppercase; }
.bsg-title    { color: #fff !important; font-size: 22px !important; font-weight: 700 !important; line-height: 1.3 !important; margin: 0 0 4px !important; }
.bsg-title span    { color: var(--bsg-gold-light); }
.bsg-subtitle { color: rgba(255,255,255,.65); font-size: 13px; margin: 0; }

/* ─── CONTAINER ─── */
.bsg-container {
  background: var(--bsg-bg);
  padding: 24px 20px 36px;
  border-radius: 0 0 12px 12px;
  border: 1.5px solid var(--bsg-border);
  border-top: none;
}

/* ─── PRICE CARD ─── */
.bsg-price-card {
  background: var(--bsg-white);
  border: 1.5px solid var(--bsg-gold);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 2px 12px rgba(26,60,110,.07);
}
.bsg-price-label {
  font-size: 13px; font-weight: 600; color: var(--bsg-muted);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.bsg-price-input-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.bsg-price-input {
  flex: 1;
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-size: 22px !important; font-weight: 700 !important;
  color: var(--bsg-navy) !important;
  border: none !important; border-bottom: 2.5px solid var(--bsg-gold) !important;
  background: transparent !important;
  padding: 4px 8px 6px !important;
  outline: none !important;
  min-width: 0;
  letter-spacing: .02em;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: auto !important;
}
.bsg-price-input:focus { border-bottom-color: var(--bsg-navy) !important; }
.bsg-unit      { font-size: 13px; color: var(--bsg-muted); white-space: nowrap; }
.bsg-price-note{ font-size: 12px; color: var(--bsg-gold); font-style: italic; white-space: nowrap; }

/* ─── ACCORDION LIST ─── */
.bsg-pttt-list { display: flex; flex-direction: column; gap: 10px; }

.bsg-pttt-item {
  background: var(--bsg-white);
  border-radius: 10px;
  border: 1.5px solid var(--bsg-border);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(26,60,110,.05);
  transition: border-color .2s;
}
.bsg-pttt-item.bsg-open { border-color: var(--bsg-navy); }

.bsg-pttt-trigger {
  display: flex; align-items: center;
  padding: 0; cursor: pointer; user-select: none;
  background: none !important; border: none !important;
  width: 100%; text-align: left;
  font-family: 'Be Vietnam Pro', sans-serif;
}
.bsg-pttt-trigger:focus { outline: 2px solid var(--bsg-gold); outline-offset: -2px; }

.bsg-pttt-badge {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 54px; flex-shrink: 0;
  font-size: 15px; font-weight: 700;
  color: var(--bsg-muted);
  background: var(--bsg-bg);
  border-right: 1.5px solid var(--bsg-border);
  transition: background .2s, color .2s;
}
.bsg-pttt-item.bsg-open .bsg-pttt-badge { background: var(--bsg-navy); color: var(--bsg-gold-light); border-color: var(--bsg-navy); }

.bsg-pttt-info   { flex: 1; padding: 14px 16px; }
.bsg-pttt-name   { font-size: 14px; font-weight: 700; color: var(--bsg-navy); margin: 0 0 2px; }
.bsg-pttt-sub    { font-size: 12px; color: var(--bsg-muted); margin: 0; }

.bsg-ck-badge {
  display: inline-flex; align-items: center;
  background: #edf4ff; color: var(--bsg-navy);
  border: 1px solid #bdd5f5; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 11px; margin-right: 14px; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.bsg-pttt-item.bsg-open .bsg-ck-badge { background: var(--bsg-gold); color: var(--bsg-navy-dark); border-color: var(--bsg-gold); }

.bsg-chevron {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-right: 14px; flex-shrink: 0;
  background: var(--bsg-bg);
  transition: transform .25s, background .2s;
}
.bsg-chevron svg { width: 14px; height: 14px; stroke: var(--bsg-muted); stroke-width: 2.5; fill: none; }
.bsg-pttt-item.bsg-open .bsg-chevron { transform: rotate(180deg); background: var(--bsg-navy-light); }
.bsg-pttt-item.bsg-open .bsg-chevron svg { stroke: #fff; }

/* ─── PANEL ─── */
.bsg-pttt-panel { display: none; }
.bsg-pttt-item.bsg-open .bsg-pttt-panel { display: block; }

/* Summary bar */
.bsg-panel-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px 18px 10px;
  background: linear-gradient(to bottom, #f0f5ff, #f4f6fb);
  border-bottom: 1px solid var(--bsg-border);
}
.bsg-sum-card { text-align: center; padding: 8px; }
.bsg-sum-label { font-size: 11px; font-weight: 600; color: var(--bsg-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.bsg-sum-val   { font-size: 14px; font-weight: 700; color: var(--bsg-navy); }
.bsg-sum-card.bsg-highlight .bsg-sum-val { color: var(--bsg-red); font-size: 16px; }
.bsg-sum-card.bsg-ck-card  .bsg-sum-val { color: #2a7a2a; }

/* Table */
.bsg-table-wrap { overflow-x: auto; padding: 0 18px 18px; }
table.bsg-schedule {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin-top: 6px;
}
table.bsg-schedule thead tr { background: var(--bsg-navy); }
table.bsg-schedule thead th {
  padding: 10px 12px;
  color: #fff; font-weight: 600; font-size: 12px; letter-spacing: .03em;
  text-align: left; white-space: nowrap;
}
table.bsg-schedule thead th:nth-child(3),
table.bsg-schedule thead th:nth-child(4) { text-align: right; }

table.bsg-schedule tbody tr { border-bottom: 1px solid var(--bsg-border); transition: background .1s; }
table.bsg-schedule tbody tr:nth-child(even) { background: var(--bsg-row-alt); }
table.bsg-schedule tbody tr:hover { background: #e8f0fc; }

/* Row variants */
table.bsg-schedule tbody tr.bsg-row-booking { background: var(--bsg-bk-bg) !important; border-left: 3px solid var(--bsg-bk-border); }
table.bsg-schedule tbody tr.bsg-row-booking:hover { background: #fff3cd !important; }
table.bsg-schedule tbody tr.bsg-row-deposit { background: var(--bsg-dp-bg) !important; border-left: 3px solid var(--bsg-dp-border); }
table.bsg-schedule tbody tr.bsg-row-deposit:hover { background: #daeeff !important; }
table.bsg-schedule tfoot tr { background: var(--bsg-navy); }

table.bsg-schedule td { padding: 9px 12px; vertical-align: top; color: var(--bsg-text); }
table.bsg-schedule td:nth-child(3),
table.bsg-schedule td:nth-child(4) { text-align: right; white-space: nowrap; }
table.bsg-schedule tfoot td { font-weight: 700; font-size: 13px; color: #fff; }

/* Labels & pills */
.bsg-dot-label {
  display: inline-block; padding: 2px 9px;
  border-radius: 20px; font-size: 11.5px; font-weight: 700;
  background: var(--bsg-navy); color: #fff; white-space: nowrap;
}
.bsg-dot-label.bsg-booking { background: var(--bsg-bk-border); color: #7a5500; }
.bsg-dot-label.bsg-deposit { background: var(--bsg-dp-border); color: #0a3d6e; }
.bsg-dot-label.bsg-final   { background: var(--bsg-gold); color: var(--bsg-navy-dark); }
.bsg-dot-label.bsg-regular { background: #e2e8f4; color: var(--bsg-navy); }

.bsg-pct-pill {
  display: inline-block; padding: 1px 7px;
  border-radius: 10px; font-size: 11.5px; font-weight: 600;
  background: #edf4ff; color: var(--bsg-navy);
}
.bsg-pct-pill.bsg-special { background: #fff3cd; color: #7a5500; }

.bsg-money             { font-weight: 600; color: var(--bsg-navy); }
.bsg-money.bsg-booking-money { color: #b07d00; }
.bsg-money.bsg-total-money   { color: #fff; font-size: 14px; }

/* ─── NOTE BOX ─── */
.bsg-note-box {
  background: #fff8e6; border: 1px solid var(--bsg-gold);
  border-radius: 8px; padding: 14px 18px;
  margin-top: 20px;
  font-size: 12.5px; color: #6b4e00; line-height: 1.7;
}
.bsg-note-box strong { color: var(--bsg-navy); }

/* ─── PRINT BUTTON ─── */
.bsg-print-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bsg-navy); color: #fff;
  border: none !important; border-radius: 7px;
  padding: 10px 22px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  margin-top: 16px; letter-spacing: .02em;
  transition: background .18s;
  line-height: 1;
}
.bsg-print-btn:hover { background: var(--bsg-navy-light) !important; color: #fff !important; }
.bsg-print-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .bsg-header { padding: 20px 16px 18px; border-radius: 10px 10px 0 0; }
  .bsg-title  { font-size: 17px !important; }
  .bsg-price-card { padding: 14px 16px; gap: 12px; }
  .bsg-price-input { font-size: 18px !important; }
  .bsg-panel-summary { gap: 6px; padding: 10px 12px 8px; }
  .bsg-table-wrap { padding: 0 10px 14px; }
  table.bsg-schedule { font-size: 12px; }
  table.bsg-schedule td { padding: 7px 8px; }
  .bsg-ck-badge { display: none; }
}

/* ─── PRINT ─── */
@media print {
  .bsg-wrap           { font-size: 11px; }
  .bsg-header         { -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 0; }
  .bsg-container      { border: none; padding: 10px 0; background: #fff; }
  .bsg-pttt-panel     { display: block !important; }
  .bsg-pttt-trigger   { display: none !important; }
  .bsg-print-btn      { display: none !important; }
  .bsg-pttt-item      { border: 1px solid #aaa !important; margin-bottom: 16px; page-break-inside: avoid; }
  table.bsg-schedule thead tr,
  table.bsg-schedule tfoot tr { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bsg-note-box       { border: 1px solid #ccc; background: #fffdf0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
