/* VN Car Booking Pro — Frontend Stylesheet
   Khung chữ nhật viền bo góc 20px, nằm dọc max-height 600px, nằm ngang ~150px */

.vncb-widget {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a;
  position: relative;
  box-sizing: border-box;
}

.vncb-widget *,
.vncb-widget *::before,
.vncb-widget *::after {
  box-sizing: border-box;
}

.vncb-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* Chế độ nằm dọc: chiều cao tối đa 600px */
.vncb-card-vertical {
  width: 100%;
  max-width: 460px;
  height: 600px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.vncb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.vncb-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.vncb-trip-toggle {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.vncb-trip-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.vncb-trip-btn.is-active {
  background: #1d4ed8;
  color: #ffffff;
}

.vncb-vertical-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vncb-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vncb-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.vncb-input-wrap {
  display: flex;
  gap: 6px;
}

.vncb-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vncb-input:focus {
  border-color: #1d4ed8;
  background: #ffffff;
}

.vncb-map-trigger {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #1d4ed8;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.vncb-map-box {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.vncb-map-canvas {
  width: 100%;
  height: 150px;
  background: #e2e8f0;
}

.vncb-distance-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
}

.vncb-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vncb-vehicle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vncb-vehicle-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vncb-vehicle-card.is-selected {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.vncb-vehicle-card img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.vncb-vehicle-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vncb-vehicle-meta strong {
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vncb-vehicle-meta span {
  font-size: 11px;
  color: #64748b;
}

.vncb-footer-vertical {
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.vncb-price-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vncb-price-breakdown {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #475569;
}

.vncb-total-val {
  font-size: 19px;
  font-weight: 800;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}

.vncb-cta-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 20px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}

.vncb-cta-btn:hover {
  background: #1e40af;
}

/* Chế độ nằm ngang: khung chữ nhật bo góc 20px, chiều cao ~150px */
.vncb-card-horizontal {
  width: 100%;
  min-height: 150px;
  height: 150px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vncb-horiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vncb-horiz-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #475569;
}

.vncb-inline-map-btn {
  border: 1px solid #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.vncb-horiz-fields {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.3fr 1.1fr 0.9fr auto;
  gap: 10px;
  align-items: end;
}

.vncb-h-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.vncb-h-field label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.vncb-h-dt-pair {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 4px;
}

.vncb-vehicle-picker-btn {
  height: 40px;
  padding: 0 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

.vncb-picker-thumb {
  width: 34px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.vncb-picker-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vncb-h-action {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vncb-h-price {
  display: flex;
  flex-direction: column;
  text-align: right;
  white-space: nowrap;
}

.vncb-h-price small {
  font-size: 11px;
  color: #64748b;
}

.vncb-h-price strong {
  font-size: 16px;
  font-weight: 800;
  color: #1d4ed8;
}

.vncb-vehicle-popover,
.vncb-map-popover {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.vncb-vehicle-popover {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.vncb-map-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vncb-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}

.vncb-modal[hidden] {
  display: none;
}

.vncb-modal-dialog {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.vncb-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.vncb-modal-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.vncb-modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.vncb-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vncb-modal-foot {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}

.vncb-gateway-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vncb-gw-item {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .vncb-card-horizontal {
    height: auto;
    min-height: 150px;
  }
  .vncb-horiz-fields {
    grid-template-columns: 1fr;
  }
}
