/* ==========================================================================
   SEAT MAP V4 — Dual-Layer: Overview + Selection Overlay
   ========================================================================== */

/* ---- Main container ---- */
.bk-venue-v4 {
  position: relative;
  background: var(--color-surface, #151413);
  border-radius: 10px;
  overflow: hidden;
  font-family: inherit;
}

/* ==================================================
   LAYER 1: OVERVIEW — full hall view with colored seats
   ================================================== */
.bk-overview {
  position: relative;
  width: 100%;
  padding: 20px 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Stage in overview */
.bk-ov-stage {
  background: linear-gradient(to bottom, rgba(212,168,83,0.22), rgba(212,168,83,0.06));
  border: 1px solid rgba(212,168,83,0.35);
  border-radius: 8px 8px 50% 50%;
  padding: 8px 32px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--color-primary, #d4a853);
  text-align: center;
  white-space: nowrap;
  margin-bottom: 4px;
}

/* SVG canvas for overview */
.bk-ov-svg {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: 0 0;
}

/* Zoomable overview wrapper */
.bk-ov-zoom-wrap {
  position: relative;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  border-radius: 8px;
}
.bk-ov-zoom-wrap:active {
  cursor: grabbing;
}
.bk-ov-zoom-inner {
  transform-origin: 0 0;
  will-change: transform;
}

/* Overview zoom controls */
.bk-ov-zoom-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}
.bk-ov-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(212,168,83,0.3);
  background: rgba(20,18,15,0.85);
  color: rgba(212,168,83,0.8);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.bk-ov-zoom-btn:hover {
  background: rgba(212,168,83,0.15);
}

/* Overview seat dots */
.bk-ov-seat {
  transition: opacity 0.2s;
}

/* Glow spotlight overlay on overview */
.bk-ov-glow {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.bk-ov-glow--active {
  opacity: 1;
}

/* Legend */
.bk-ov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 4px 10px;
}

.bk-ov-leg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  color: rgba(255,255,255,0.55);
}

.bk-ov-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.bk-ov-dot--free   { background: #3a7d2c; }
.bk-ov-dot--sold   { background: #7a2020; }
.bk-ov-dot--picked { background: #d4a853; }

/* "Buy tickets" button */
.bk-ov-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary, #d4a853);
  color: #1a1612;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.bk-ov-buy-btn:hover {
  background: #e0c46a;
  transform: scale(1.03);
}
.bk-ov-buy-btn:active {
  transform: scale(0.97);
}

/* ==================================================
   LAYER 2: SELECTION OVERLAY — semi-transparent over overview
   ================================================== */
.bk-sel-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  flex-direction: column;
  background: rgba(10, 8, 6, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bk-overlay-in 0.3s ease-out;
}
.bk-sel-overlay--open {
  display: flex;
}

@keyframes bk-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Overlay header */
.bk-sel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bk-sel-header h3 {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin: 0;
}

.bk-sel-close-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  transition: background 0.15s;
}
.bk-sel-close-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Sector tabs in overlay */
.bk-sel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 6px;
  justify-content: center;
  flex-shrink: 0;
}

.bk-sel-tab {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  white-space: nowrap;
  font-family: inherit;
}
.bk-sel-tab:hover {
  background: rgba(212,168,83,0.12);
  border-color: rgba(212,168,83,0.35);
  color: #d4a853;
}
.bk-sel-tab--active {
  background: rgba(212,168,83,0.18);
  border-color: rgba(212,168,83,0.6);
  color: #d4a853;
  font-weight: 600;
}

/* Main content area: seat grid + sidebar */
.bk-sel-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Seat grid viewport — zoomable/pannable */
.bk-sel-grid-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.bk-sel-grid-viewport:active {
  cursor: grabbing;
}

/* Inner canvas for seats */
.bk-sel-grid-canvas {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
  transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.bk-sel-grid-canvas--no-anim {
  transition: none !important;
}

/* Zoom controls inside overlay */
.bk-sel-zoom-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.bk-sel-zoom-btn {
  background: rgba(20,17,14,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  font-family: inherit;
  transition: background 0.15s;
}
.bk-sel-zoom-btn:hover {
  background: rgba(212,168,83,0.2);
  border-color: rgba(212,168,83,0.5);
  color: #d4a853;
}

/* Grid seat button */
.bk-sg {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: box-shadow 0.12s, background 0.12s, border-color 0.12s, transform 0.1s;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}
.bk-sg span {
  display: block;
  line-height: 1.1;
}
.bk-sg .sg-row {
  font-size: 7px;
  opacity: 0.6;
}
.bk-sg .sg-num {
  font-size: 10px;
  font-weight: 600;
}

/* Grid seat colors */
.bk-sg--free {
  background: #3a7d2c;
  color: #fff;
  border-color: rgba(255,255,255,0.08);
}
.bk-sg--free:hover {
  background: #4a9e38;
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.bk-sg--sold {
  background: #7a2020;
  color: rgba(255,255,255,0.35);
  cursor: not-allowed;
  pointer-events: none;
}

.bk-sg--blocked {
  background: #2e2e2e;
  color: rgba(255,255,255,0.18);
  cursor: not-allowed;
  pointer-events: none;
}

.bk-sg--picked {
  background: #d4a853;
  color: #1a1612;
  border-color: rgba(255,255,255,0.35);
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(212,168,83,0.5), 0 2px 10px rgba(212,168,83,0.4);
  animation: bk-sg-pulse 1.6s ease-in-out infinite;
}
.bk-sg--picked:hover {
  background: #e0b960;
}

.bk-sg--vip {
  background: #6b4fa0;
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}
.bk-sg--vip:hover {
  background: #8261be;
  transform: scale(1.1);
  z-index: 5;
}

/* Lozhe — soft steel-blue */
.bk-sg--lozhe {
  background: #3a6d94;
  color: #fff;
  border-color: rgba(255,255,255,0.10);
}
.bk-sg--lozhe:hover {
  background: #4a87b4;
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(58,109,148,0.5);
}

/* Balcony — soft muted teal-blue */
.bk-sg--balcony {
  background: #2d5a7a;
  color: #cde;
  border-color: rgba(255,255,255,0.08);
}
.bk-sg--balcony:hover {
  background: #3a72a0;
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(45,90,122,0.5);
}

@keyframes bk-sg-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(212,168,83,0.5), 0 2px 10px rgba(212,168,83,0.35); }
  50%      { box-shadow: 0 0 0 4px rgba(212,168,83,0.25), 0 2px 14px rgba(212,168,83,0.55); }
}

/* Row labels on the grid */
.bk-sg-row-label {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  pointer-events: none;
}

/* Stage label in grid */
.bk-sg-stage {
  position: absolute;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--color-primary, #d4a853);
  background: linear-gradient(to bottom, rgba(212,168,83,0.15), rgba(212,168,83,0.03));
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 6px;
  padding: 4px 16px;
  white-space: nowrap;
  pointer-events: none;
}

/* ==================================================
   SIDEBAR: Selected seats panel
   ================================================== */
.bk-sel-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(20,17,14,0.6);
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bk-sel-sidebar h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin: 0;
  padding: 14px 14px 8px;
  flex-shrink: 0;
}

.bk-sel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px;
}

.bk-sel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
}

.bk-sel-item__info {
  flex: 1;
}
.bk-sel-item__price {
  color: #d4a853;
  font-weight: 600;
  white-space: nowrap;
}
.bk-sel-item__remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  line-height: 1;
  font-family: inherit;
}
.bk-sel-item__remove:hover {
  color: #e05050;
}

/* Empty state */
.bk-sel-empty {
  padding: 24px 14px;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.82rem;
}

/* Footer with total + confirm */
.bk-sel-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.bk-sel-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.bk-sel-total-label {
  color: rgba(255,255,255,0.6);
}
.bk-sel-total-value {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.bk-sel-confirm-btn {
  width: 100%;
  background: var(--color-primary, #d4a853);
  color: #1a1612;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, transform 0.1s;
}
.bk-sel-confirm-btn:hover {
  background: #e0c46a;
  transform: scale(1.02);
}
.bk-sel-confirm-btn:active {
  transform: scale(0.97);
}
.bk-sel-confirm-btn:disabled {
  background: rgba(212,168,83,0.3);
  color: rgba(26,22,18,0.5);
  cursor: not-allowed;
  transform: none;
}

/* ==================================================
   TOAST (reuse from v3)
   ================================================== */
.bk-toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.bk-toast {
  background: rgba(30,26,22,0.95);
  border: 1px solid rgba(212,168,83,0.3);
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.84rem;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: bk-toast-in 0.25s ease-out;
}
.bk-toast--warning { border-color: rgba(230,150,50,0.5); color: #e09040; }
.bk-toast--error   { border-color: rgba(200,60,60,0.5); color: #e05050; }
.bk-toast--success { border-color: rgba(60,180,80,0.5); color: #55cc66; }
@keyframes bk-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   RESPONSIVE — mobile
   ================================================== */
@media (max-width: 768px) {
  .bk-sel-body {
    flex-direction: column;
  }
  .bk-sel-sidebar {
    width: 100%;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .bk-sel-grid-viewport {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .bk-ov-stage {
    padding: 6px 20px;
    font-size: 0.6rem;
  }
  .bk-ov-buy-btn {
    padding: 10px 22px;
    font-size: 0.88rem;
  }
  .bk-sel-sidebar {
    max-height: 180px;
  }
  .bk-sg {
    width: 26px;
    height: 26px;
    font-size: 8px;
  }
}

/* ======================== ZONE PRICE LEGEND ======================== */
.bk-ov-zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  margin: 4px 0 2px;
  border: 1px solid rgba(212,168,83,0.12);
}

.bk-ov-zone-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.82);
  white-space: nowrap;
}

.bk-ov-zone-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 0 3px rgba(0,0,0,0.4);
}

.bk-ov-zone-text {
  font-weight: 500;
}

/* ======================== PREVIEW MODE ======================== */
/* Yellow/amber seats in preview (no active event) */
.bk-sg--preview {
  background-color: #b8a040 !important;
  border-color: #b8a040 !important;
  cursor: default !important;
  opacity: 0.7;
}

.bk-sg--preview:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Preview banner */
.bk-ov-preview-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(184, 160, 64, 0.15);
  border: 1px solid rgba(184, 160, 64, 0.35);
  border-radius: 10px;
  color: #d4c070;
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 8px 0 4px;
}

.bk-ov-preview-banner svg {
  color: #d4a853;
}

/* Preview toast */
.bk-preview-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 28, 22, 0.95);
  border: 1px solid rgba(184, 160, 64, 0.4);
  color: #d4c070;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.88rem;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.bk-preview-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
