/* ==========================================================================
   TRANG HỆ THỐNG PHÂN PHỐI & ĐẠI LÝ CHUẨN 100% CADIVI.VN (phan-phoi.html)
   VIỄN ĐÔNG ELECTRIC — NHÀ PHÂN PHỐI THIẾT BỊ ĐIỆN ABB CHÍNH THỨC
   ========================================================================== */

/* 1. Sub-Banner & Breadcrumb chuẩn CADIVI */
.pp-banner-sub {
  position: relative;
  background: linear-gradient(135deg, #0b2247 0%, #153a72 50%, #ed1c24 100%);
  color: #ffffff;
  padding: 42px 0 38px;
  overflow: hidden;
  border-bottom: 3px solid var(--primary-red);
}

.pp-banner-sub::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to right, rgba(237, 28, 36, 0.15), transparent);
  background-size: 24px 24px, 100% 100%;
  pointer-events: none;
}

.pp-breadcrumb {
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

.pp-breadcrumb ul {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.pp-breadcrumb li a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.25s ease;
}

.pp-breadcrumb li a:hover {
  color: #ffd600;
  text-decoration: underline;
}

.pp-breadcrumb li::after {
  content: '›';
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.6);
}

.pp-breadcrumb li:last-child::after {
  content: '';
  margin-left: 0;
}

.pp-breadcrumb li span {
  color: #ffffff;
  font-weight: 600;
}

.pp-banner-heading {
  position: relative;
  z-index: 2;
}

.pp-banner-heading h1 {
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 44px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.pp-banner-heading p {
  font-size: 16px;
  line-height: 25px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 820px;
  margin: 0;
}

/* 2. Main Title Section với gạch chân đỏ CADIVI */
.pp-main-section {
  padding: 38px 0 55px;
  background: #f8fafc;
}

.pp-title-box {
  text-align: center;
  margin-bottom: 28px;
}

.pp-title-box h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 42px;
  font-weight: 700;
  color: var(--primary-red);
  text-transform: uppercase;
  display: inline-block;
  margin: 0;
}

.pp-title-box h2::after {
  content: '';
  display: block;
  width: 70px;
  height: 3px;
  background: var(--primary-red);
  margin: 10px auto 0;
  border-radius: 2px;
}

.pp-title-box .pp-slogan {
  font-size: 15.5px;
  color: #64748b;
  margin-top: 10px;
}

/* 3. Khung Bộ Lọc & Tìm Kiếm Đa Chiều Chuẩn CADIVI (Filter Card) */
.pp-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(11, 34, 71, 0.06);
  margin-bottom: 30px;
}

.pp-region-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.pp-region-label {
  font-weight: 700;
  font-size: 14.5px;
  color: #1e293b;
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pp-pill-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pp-pill-btn:hover {
  background: #fee2e2;
  color: var(--primary-red);
  border-color: #fca5a5;
}

.pp-pill-btn.active {
  background: var(--primary-red);
  color: #ffffff;
  border-color: var(--primary-red);
  box-shadow: 0 4px 10px rgba(237, 28, 36, 0.3);
}

.pp-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.2fr auto;
  gap: 14px;
  align-items: end;
}

.pp-filter-item {
  display: flex;
  flex-direction: column;
}

.pp-filter-item label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.pp-filter-select,
.pp-filter-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.pp-filter-select:focus,
.pp-filter-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.15);
}

.pp-filter-actions {
  display: flex;
  gap: 8px;
}

.pp-btn-search {
  height: 42px;
  padding: 0 22px;
  background: var(--primary-red);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.25s ease, transform 0.15s ease;
  white-space: nowrap;
}

.pp-btn-search:hover {
  background: #c5141b;
  transform: translateY(-1px);
}

.pp-btn-reset {
  height: 42px;
  padding: 0 16px;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.pp-btn-reset:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Thống kê kết quả tìm kiếm */
.pp-results-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
  font-size: 14px;
  color: #64748b;
}

.pp-results-stats strong {
  color: var(--primary-red);
  font-size: 15px;
}

/* 4. Khung 2 Cột: Danh sách đại lý & Bản đồ định vị */
.pp-content-layout {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 24px;
  align-items: start;
}

/* Cột Trái: Danh sách đại lý */
.pp-dealer-list-wrap {
  display: flex;
  flex-direction: column;
}

.pp-dealer-scroll {
  max-height: 720px;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom Scrollbar cho danh sách đại lý */
.pp-dealer-scroll::-webkit-scrollbar {
  width: 6px;
}
.pp-dealer-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.pp-dealer-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.pp-dealer-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Thẻ Đại Lý (Dealer Card) */
.dealer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-red);
  border-radius: 6px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(11, 34, 71, 0.04);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.dealer-card:hover {
  border-color: #fca5a5;
  border-left-color: var(--primary-red);
  box-shadow: 0 8px 24px rgba(237, 28, 36, 0.12);
  transform: translateY(-2px);
}

.dealer-card.selected {
  border-color: var(--primary-red);
  background: #fffdfd;
  box-shadow: 0 8px 28px rgba(237, 28, 36, 0.16);
}

.dc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.dc-badge-type {
  display: inline-block;
  padding: 3px 8px;
  background: #fee2e2;
  color: var(--primary-red);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  letter-spacing: 0.3px;
}

.dc-badge-type.headquarters {
  background: #0b2247;
  color: #ffd600;
}

.dc-badge-abb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  padding: 2px 7px;
  border-radius: 3px;
}

.dc-name {
  font-family: var(--font-heading);
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
  transition: color 0.2s ease;
}

.dealer-card:hover .dc-name,
.dealer-card.selected .dc-name {
  color: var(--primary-red);
}

.dc-city-pill {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dc-info-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: #475569;
  line-height: 20px;
  margin-bottom: 14px;
}

.dc-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.dc-info-row .dc-icon {
  flex-shrink: 0;
  color: var(--primary-red);
  margin-top: 2px;
}

.dc-info-row a {
  color: #1e293b;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dc-info-row a:hover {
  color: var(--primary-red);
  text-decoration: underline;
}

.dc-products-tag {
  font-size: 12px;
  background: #f8fafc;
  padding: 5px 8px;
  border-radius: 3px;
  color: #475569;
  border: 1px dashed #cbd5e1;
  margin-bottom: 14px;
}

.dc-products-tag strong {
  color: #1e293b;
}

.dc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dc-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.dc-btn-map {
  background: #fee2e2;
  color: var(--primary-red);
  border: 1px solid #fecaca;
}

.dc-btn-map:hover {
  background: var(--primary-red);
  color: #ffffff;
}

.dc-btn-nav {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.dc-btn-nav:hover {
  background: #0b2247;
  color: #ffffff;
  border-color: #0b2247;
}

.dc-btn-quote {
  background: #f8fafc;
  color: #047857;
  border: 1px solid #a7f3d0;
  margin-left: auto;
}

.dc-btn-quote:hover {
  background: #047857;
  color: #ffffff;
}

/* Cột Phải: Bản đồ tương tác */
.pp-map-panel {
  position: sticky;
  top: 90px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(11, 34, 71, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pp-map-header {
  background: #0b2247;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pp-map-header h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-map-quick-cities {
  display: flex;
  gap: 6px;
}

.pp-quick-city-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pp-quick-city-btn:hover,
.pp-quick-city-btn.active {
  background: var(--primary-red);
  border-color: var(--primary-red);
}

.pp-map-frame-box {
  width: 100%;
  height: 540px;
  position: relative;
  background: #e2e8f0;
}

.pp-map-frame-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Hộp thông tin đại lý nổi trên bản đồ */
.pp-map-info-overlay {
  background: #ffffff;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.pp-map-info-text {
  flex: 1;
}

.pp-map-info-title {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 4px;
}

.pp-map-info-addr {
  font-size: 13px;
  color: #475569;
}

.pp-map-info-action a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary-red);
  color: #ffffff;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.pp-map-info-action a:hover {
  background: #c5141b;
}

/* 5. Khối Chính Sách Quyền Lợi Đại Lý (Dealer Policy Benefits) */
.pp-policy-section {
  padding: 60px 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.pp-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 36px;
}

.pp-policy-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 26px 22px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pp-policy-box:hover {
  background: #ffffff;
  border-color: #fca5a5;
  box-shadow: 0 12px 28px rgba(237, 28, 36, 0.12);
  transform: translateY(-4px);
}

.pp-policy-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #fee2e2;
  color: var(--primary-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
  transition: all 0.3s ease;
}

.pp-policy-box:hover .pp-policy-icon {
  background: var(--primary-red);
  color: #ffffff;
  transform: scale(1.05);
}

.pp-policy-title {
  font-family: var(--font-heading);
  font-size: 18px;
  line-height: 25px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.pp-policy-desc {
  font-size: 14px;
  line-height: 22px;
  color: #64748b;
  margin: 0;
}

/* 6. Form Đăng Ký Trở Thành Đại Lý (Dealer Registration CTA Box) */
.pp-register-section {
  padding: 60px 0 70px;
  background: linear-gradient(135deg, #0b2247 0%, #153a72 65%, #1a427f 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.pp-register-section::after {
  content: '';
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(237, 28, 36, 0.28) 0%, transparent 70%);
  pointer-events: none;
}

.pp-reg-wrapper {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.pp-reg-header {
  text-align: center;
  margin-bottom: 32px;
}

.pp-reg-header h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 42px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 8px;
}

.pp-reg-header p {
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin: 0 auto;
}

.pp-reg-form {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 32px;
  backdrop-filter: blur(10px);
}

.pp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pp-form-full {
  margin-bottom: 16px;
}

.pp-input-wrap label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.pp-input-wrap input,
.pp-input-wrap select,
.pp-input-wrap textarea {
  width: 100%;
  height: 44px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 14px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.pp-input-wrap textarea {
  height: 85px;
  padding: 10px 14px;
  resize: vertical;
}

.pp-input-wrap input:focus,
.pp-input-wrap select:focus,
.pp-input-wrap textarea:focus {
  border-color: #ffd600;
  box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.25);
}

.pp-reg-submit-btn {
  width: 100%;
  height: 48px;
  background: var(--primary-red);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(237, 28, 36, 0.4);
}

.pp-reg-submit-btn:hover {
  background: #ff333a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(237, 28, 36, 0.5);
}

.pp-reg-notice {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
}

/* 7. Modal Nhận Báo Giá Nhanh Cho Đại Lý (#quoteModal) */
.pp-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 15px;
  backdrop-filter: blur(4px);
}

.pp-modal-backdrop.show {
  display: flex;
}

.pp-modal-box {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.pp-modal-header {
  background: #0b2247;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pp-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0;
}

.pp-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.pp-modal-body {
  padding: 22px 20px;
}

/* Responsive Breakpoints */
@media screen and (max-width: 1080px) {
  .pp-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pp-content-layout {
    grid-template-columns: 1fr;
  }
  .pp-map-panel {
    position: static;
    order: -1;
    margin-bottom: 24px;
  }
  .pp-policy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .pp-banner-heading h1 {
    font-size: 25px;
    line-height: 34px;
  }
  .pp-filter-grid {
    grid-template-columns: 1fr;
  }
  .pp-form-row {
    grid-template-columns: 1fr;
  }
  .pp-policy-grid {
    grid-template-columns: 1fr;
  }
  .pp-map-frame-box {
    height: 360px;
  }
  .pp-map-info-overlay {
    flex-direction: column;
    align-items: flex-start;
  }
}
