/* Smart seat selection page — viewport-fit layout */
body.ssm-selection-layout .main-header,
body.ssm-selection-layout .footer-section {
  display: none !important;
}

body.smart-seat-page,
body.smart-seat-page .page-wrapper {
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body.ssm-selection-layout .page-wrapper {
  min-height: 0;
}

.smart-seat-page {
  height: 100vh;
  overflow: hidden;
  background: #f5f6f8;
  display: flex;
  flex-direction: column;
}

.ssm-selection-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.ssm-back-link {
  color: #333;
  font-size: 1.1rem;
  text-decoration: none;
}

.ssm-event-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.smart-seat-content {
  height: calc(100vh - 145px);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 16px;
  padding-bottom: 0;
}

.smart-seat-main {
  flex: 1;
  display: flex;
  gap: 24px;
  min-height: 0;
  overflow: hidden;
}

.ssm-sidebar {
  flex: 0 0 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.ssm-sidebar-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.ssm-sidebar-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.ssm-sidebar-card--chosen {
  margin-bottom: 0;
}

.ssm-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  margin-bottom: 0.75rem;
}

.ssm-category-list {
  margin: 0;
}

.ssm-category-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.ssm-category-item:last-child {
  margin-bottom: 0;
}

.ssm-category-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.ssm-chosen-seats {
  line-height: 1.5;
}

.ssm-chosen-seats .ssm-seat-tag {
  display: inline-block;
  background: #e7f1ff;
  color: #004085;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  font-weight: 600;
  font-size: 0.8rem;
}

.smart-seat-map-area,
.ssm-map-column {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.smart-map-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.smart-zoom-controls,
.ssm-map-toolbar {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.smart-seat-map-box,
.ssm-map-viewport {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 260px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  cursor: grab;
  position: relative;
  width: 100%;
}

.ssm-map-viewport.is-panning {
  cursor: grabbing;
}

.ssm-map-scaler {
  transform-origin: top left;
  transition: transform 0.15s ease;
  display: inline-block;
  padding: 12px;
  min-width: min-content;
}

.smart-seat-buyer-map .seat.available {
  background-color: #c5e08a !important;
  border-color: #9ab86a;
}

.smart-seat-buyer-map .seat.blocked {
  background-color: #adb5bd !important;
  border-color: #868e96;
  cursor: not-allowed;
  opacity: 0.9;
}

.smart-seat-buyer-map .seat.booked {
  background-color: #dc3545 !important;
  border-color: #bd2130;
  cursor: not-allowed;
  opacity: 0.9;
}

.smart-seat-buyer-map .seat.available.clickable {
  cursor: pointer;
}

.smart-seat-buyer-map .seat.selected {
  outline: 2px solid #007bff !important;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007bff;
  z-index: 2;
  position: relative;
}

.smart-bottom-bar {
  height: 82px;
  min-height: 82px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 90px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  margin-top: 12px;
  padding: 0;
  border-radius: 8px;
  flex-shrink: 0;
}

.smart-total-box {
  width: 180px;
  text-align: left;
}

.smart-total-box span {
  display: block;
  font-size: 14px;
  color: #6b7280;
}

.smart-total-box strong {
  display: block;
  font-size: 24px;
  line-height: 28px;
  font-weight: 700;
  color: #111827;
}

.smart-action-box {
  flex: 0 0 auto;
}

.smart-action-box form {
  margin: 0;
}

.login-to-book-btn,
.smart-action-box .ssm-login-book-btn {
  width: 280px;
  height: 48px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  background: #1640d3;
  color: #fff;
  cursor: pointer;
  padding: 0 1.25rem;
}

.login-to-book-btn:hover,
.login-to-book-btn:focus,
.smart-action-box .ssm-login-book-btn:hover,
.smart-action-box .ssm-login-book-btn:focus {
  background: #1235b8;
  color: #fff;
}

.smart-action-box .ssm-login-book-btn.ssm-btn-inactive {
  opacity: 0.85;
}

@media (max-width: 767px) {
  body.smart-seat-page {
    overflow: hidden;
  }

  body.smart-seat-page,
  body.smart-seat-page .page-wrapper {
    height: 100vh;
    overflow: hidden;
  }

  .smart-seat-page,
  .smart-seat-page-wrapper {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 90px;
    box-sizing: border-box;
  }

  .smart-seat-content {
    flex: 1;
    height: auto;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 0;
    margin-bottom: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  .smart-seat-main {
    flex: 1;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    overflow: visible;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  /* Order: Categories → Map → Chosen */
  .ssm-sidebar {
    display: contents;
  }

  .ssm-sidebar-hint {
    display: none;
  }

  .seat-category-card,
  .ssm-sidebar-card--categories {
    order: 1;
    padding: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
  }

  .smart-seat-map-area,
  .ssm-map-column {
    order: 2;
    flex: 0 0 auto;
    overflow: visible;
    margin-bottom: 8px;
    padding-bottom: 0;
  }

  .smart-map-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 0;
  }

  .smart-zoom-controls,
  .ssm-map-toolbar.smart-zoom-controls {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
    z-index: 1;
  }

  .smart-zoom-controls button,
  .smart-zoom-controls .btn {
    background: #16aeb3;
    color: #fff;
    border: 1px solid #0f8f94;
    border-radius: 6px;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    box-shadow: none;
  }

  .smart-zoom-controls .reset-btn {
    width: 64px;
    font-size: 13px;
  }

  .smart-seat-map-box,
  .ssm-map-viewport {
    position: relative;
    flex: none;
    height: 46vh;
    max-height: 46vh;
    min-height: 0;
    overflow: auto;
    margin-bottom: 0;
    padding-bottom: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    -webkit-overflow-scrolling: touch;
  }

  .smart-chosen-card,
  .seat-chosen-card,
  .ssm-sidebar-card--chosen {
    order: 3;
    flex-shrink: 0;
    min-height: auto;
    padding: 14px;
    margin-bottom: 0;
  }

  .smart-chosen-card.empty {
    height: 90px;
  }

  .ssm-map-scaler {
    padding: 8px;
  }

  .smart-seat-map-box .seat-map-wrapper,
  .smart-seat-map-box .smart-seat-preview-wrapper {
    padding: 8px;
    max-width: none;
  }

  .smart-seat-buyer-map .seat,
  .smart-seat-buyer-map button.seat,
  .smart-seat-buyer-map .smart-seat {
    width: 42px !important;
    height: 42px !important;
    font-size: 13px !important;
    margin: 3px !important;
  }

  .smart-seat-buyer-map .seat-placeholder {
    width: 42px !important;
    height: 42px !important;
    margin: 3px !important;
  }

  .smart-seat-buyer-map .seat-grid {
    column-gap: 3px !important;
  }

  .smart-seat-buyer-map .seat-row {
    margin-bottom: 6px;
  }

  .smart-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 76px;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    margin-top: 0;
    margin-bottom: 0;
    background: #fff;
    border-top: none;
    border-radius: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    flex-shrink: 0;
  }

  .smart-total-box {
    width: auto;
    flex: 0 0 auto;
    text-align: left;
  }

  .smart-total-box span {
    font-size: 12px;
  }

  .smart-total-box strong {
    font-size: 22px;
    line-height: 1.2;
  }

  .smart-action-box {
    flex: 0 0 auto;
  }

  .login-to-book-btn,
  .smart-action-box .ssm-login-book-btn {
    width: 170px;
    max-width: 170px;
    height: 44px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
  }
}

/* Event detail ticket card — Book Now button */
.smart-seat-event-actions {
  text-align: left;
}

.smart-seat-book-btn {
  display: inline-block;
  min-width: 140px;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
}

.smart-seat-book-btn:hover {
  color: #fff;
  text-decoration: none;
}
