@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══════════════════════════════════════════
   PROMO — komponen halaman promo
   Ditulis ulang mengikuti design system customer-pov
   (token warna, radius, shadow, dark mode).
   ═══════════════════════════════════════════ */

.promo-toolbar {
  position: relative;
  z-index: 99;
  margin-bottom: 16px;
}

.promo-filter-select {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text-dark);
  outline: none;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#promo-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.car-section {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.car-title-header {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  border-bottom: 2px solid var(--primary-red);
  padding-bottom: 8px;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

/* Kartu paket: scroll horizontal di mobile, grid di desktop */
.promo-paket-grid {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 14px;
  width: 100%;
  padding-bottom: 10px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}

.promo-paket-grid::-webkit-scrollbar { height: 3px; }
.promo-paket-grid::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.promo-card {
  flex: 0 0 85%;
  scroll-snap-align: start;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.promo-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.promo-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-light);
}

.skema-chip {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
  white-space: nowrap;
}

.promo-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.promo-section-header .section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
}

.promo-total {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.promo-loading,
.promo-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
}

.main-tenor-preview {
  background: var(--bg-card);
  padding: 16px 12px;
  text-align: center;
  border-bottom: 1px dashed var(--border-color);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main-tenor-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.main-tenor-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--green-success);
  margin: 4px 0;
}

.main-tenor-price span { color: var(--text-muted) !important; }

.btn-detail-promo {
  width: 100%;
  padding: 13px;
  border: none;
  background: var(--v5-cta);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: opacity var(--transition-fast);
  margin-top: auto;
}

.btn-detail-promo:hover { opacity: 0.92; }
.btn-detail-promo * { pointer-events: none; }

/* ── Modal detail promo ── */
.promo-modal-overlay {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  background-color: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.promo-modal-overlay.show-modal { display: flex; }

.modal-center-box {
  background: var(--bg-card);
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  animation: popZoom 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
}

@keyframes popZoom {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.promo-modal-overlay .modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.promo-modal-overlay .modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

.promo-modal-overlay .modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.promo-modal-overlay .modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
}

.modal-promo-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  object-fit: cover;
  background: var(--bg-surface);
  display: block;
  max-height: 160px;
}

.promo-modal-skema {
  background: var(--bg-surface);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 11px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.promo-modal-skema span {
  color: var(--text-body);
  font-weight: 700;
}

.promo-modal-skema strong {
  color: var(--primary-blue);
  background: var(--primary-blue-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.promo-modal-simulasi-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.modal-tenor-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

.modal-tenor-card:hover { border-color: var(--text-muted); }

.modal-tenor-card.selected {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.modal-tenor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.modal-tenor-row .t-bulan {
  font-weight: 700;
  color: var(--primary-blue);
  font-size: 13px;
}

.modal-tenor-row .t-cicilan {
  font-weight: 800;
  color: var(--green-success);
  font-size: 14px;
}

.modal-tenor-row .t-cicilan span { color: var(--text-muted) !important; }

.modal-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  margin-top: 6px;
}

.modal-grid-info span {
  color: var(--text-muted);
  display: block;
  font-size: 10px;
  margin-bottom: 2px;
}

.modal-grid-info strong {
  color: var(--text-dark);
  font-size: 12px;
}

.promo-modal-overlay .modal-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* ── Searchable dropdown unit ── */
.custom-select-container {
  position: relative;
  flex: 1;
  z-index: 10;
}

.custom-select-container.open { z-index: 1000; }

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.custom-select-trigger:hover { border-color: var(--primary-blue); }

.custom-select-trigger i {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-select-container.open .custom-select-trigger i {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: none;
  flex-direction: column;
  max-height: 280px;
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}

.custom-select-container.open .custom-select-dropdown { display: flex; }

.dropdown-search-wrap {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.dropdown-search-wrap i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.dropdown-search-input {
  width: 100%;
  padding: 10px 12px 10px 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  background: var(--bg-card);
  color: var(--text-dark);
}

.dropdown-search-input:focus { border-color: var(--primary-blue); }

.dropdown-options-list {
  overflow-y: auto;
  flex: 1;
  max-height: 200px;
}

.dropdown-option {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition-fast);
}

.dropdown-option:hover { background: var(--bg-surface); }

.dropdown-option.active {
  background: var(--primary-blue-subtle);
  color: var(--primary-blue);
}

.dropdown-option i {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-option.active i { color: var(--primary-blue); }

/* ── Desktop: kartu paket jadi grid, modal lebih lebar ── */
@media (min-width: 768px) {
  .promo-paket-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .promo-card { flex: unset; }
  .modal-center-box { max-width: 480px; }
}

@media (min-width: 1024px) {
  .promo-paket-grid { grid-template-columns: repeat(3, 1fr); }
  .promo-toolbar { max-width: 640px; }
}
