/* ============================================================
   BÁO GIÁ FORM — CSS
   Tận dụng class .pn-* từ style.css của theme.
   File này chỉ thêm style RIÊNG cho phần form (radio, checkbox,
   tổng giá, submit box).
   ============================================================ */

.pn-bg-form-wrap {
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pn-bg-section {
  margin-bottom: 32px;
}

/* ============================================================
   SECTION 1: CHỌN GÓI (radio card)
   ============================================================ */
.pn-bg-pkg-card {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.pn-bg-pkg-card .pn-bg-pkg-check {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #10B981;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity 0.2s;
}

/* State: được chọn */
.pn-bg-pkg-card:has(.pn-bg-pkg-radio:checked) {
  border-color: #10B981 !important;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.18) !important;
  transform: translateY(-4px);
}
.pn-bg-pkg-card:has(.pn-bg-pkg-radio:checked) .pn-bg-pkg-check {
  opacity: 1;
}

/* Fallback cho trình duyệt cũ không hỗ trợ :has */
.pn-bg-pkg-card.is-selected {
  border-color: #10B981 !important;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.18) !important;
  transform: translateY(-4px);
}
.pn-bg-pkg-card.is-selected .pn-bg-pkg-check { opacity: 1; }

/* ============================================================
   SECTION 2: ADDONS (checkbox list)
   ============================================================ */
.pn-bg-addons-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pn-bg-addon-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pn-bg-addon-item:hover {
  border-color: #1B4F8A;
  background: #F8FAFC;
}

.pn-bg-addon-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pn-bg-addon-box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid #D1D5DB;
  border-radius: 6px;
  background: #fff;
  position: relative;
  transition: all 0.15s ease;
}

.pn-bg-addon-item:has(input:checked) .pn-bg-addon-box,
.pn-bg-addon-item.is-checked .pn-bg-addon-box {
  background: #1B4F8A;
  border-color: #1B4F8A;
}

.pn-bg-addon-item:has(input:checked) .pn-bg-addon-box::after,
.pn-bg-addon-item.is-checked .pn-bg-addon-box::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.pn-bg-addon-item:has(input:checked),
.pn-bg-addon-item.is-checked {
  border-color: #1B4F8A;
  background: rgba(27, 79, 138, 0.04);
}

.pn-bg-addon-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pn-bg-addon-name {
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  line-height: 1.4;
}

.pn-bg-addon-unit {
  font-size: 12px;
  color: #6B7280;
}

.pn-bg-addon-price {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: #1B4F8A;
  white-space: nowrap;
}

.pn-bg-addon-price .pn-price-quote {
  display: inline-block;
  background: #FAF5E8;
  color: #1B4F8A;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #E8D5A3;
}

/* ============================================================
   SECTION 2: ADDONS — group label + 3 loại addon
   ============================================================ */
.pn-bg-group-label {
  margin: 24px 0 12px !important;
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #1B4F8A !important;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.2px;
}

.pn-bg-group-label:first-of-type { margin-top: 0 !important; }

.pn-bg-group-icon {
  font-size: 20px;
  line-height: 1;
}

/* Addon item — mở rộng để chứa description + quantity row */
.pn-bg-addon-item {
  display: flex;
  align-items: flex-start;  /* căn trên thay vì giữa khi có nhiều dòng */
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pn-bg-addon-box {
  flex: 0 0 auto;
  margin-top: 2px;  /* căn theo dòng đầu của text */
}

.pn-bg-addon-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pn-bg-addon-desc {
  font-size: 12.5px;
  color: #6B7280;
  line-height: 1.5;
  font-weight: 400;
}

.pn-bg-addon-unit-inline {
  font-size: 12px;
  color: #6B7280;
  font-weight: 400;
}

/* Quantity row */
.pn-bg-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #E5E7EB;
  flex-wrap: wrap;
}

.pn-bg-qty-label {
  font-size: 12.5px;
  color: #374151;
  font-weight: 600;
}

.pn-bg-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pn-bg-qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  color: #1B4F8A;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.pn-bg-qty-btn:hover {
  background: #1B4F8A;
  color: #fff;
}

.pn-bg-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pn-bg-qty-input {
  width: 56px;
  height: 32px;
  border: none;
  border-left: 1.5px solid #D1D5DB;
  border-right: 1.5px solid #D1D5DB;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #1A1A1A;
  font-family: inherit;
  background: #fff;
  -moz-appearance: textfield;
}

.pn-bg-qty-input::-webkit-outer-spin-button,
.pn-bg-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pn-bg-qty-input:focus {
  outline: none;
  background: #FFFBEB;
}

.pn-bg-qty-unit {
  font-size: 12.5px;
  color: #6B7280;
  font-style: italic;
}

/* Line total cho addon dạng quantity */
.pn-bg-addon-line-total {
  display: inline-block;
  font-weight: 700;
  color: #1B4F8A;
}

/* ============================================================
   CREDITS — Tài nguyên đã có sẵn (giảm trừ)
   ============================================================ */
.pn-bg-credits-wrap {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed #E5E7EB;
}

.pn-bg-credits-title {
  font-size: 13.5px;
  color: #374151;
  margin-bottom: 12px;
  line-height: 1.5;
}

.pn-bg-credits-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Credit item - màu xanh lá khi tích (vì là giảm giá, "tốt") */
.pn-bg-credit-item.is-checked {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.05) !important;
}
.pn-bg-credit-item.is-checked .pn-bg-addon-box {
  background: #10B981 !important;
  border-color: #10B981 !important;
}

.pn-bg-credit-item.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #F9FAFB;
}
.pn-bg-credit-item.is-disabled:hover {
  border-color: #E5E7EB !important;
  background: #F9FAFB !important;
}

.pn-bg-credit-price {
  color: #10B981 !important;
  font-weight: 700;
}
.pn-bg-credit-item.is-disabled .pn-bg-credit-price {
  color: #9CA3AF !important;
  font-style: italic;
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* Giá âm trong breakdown box xanh navy */
.pn-bg-summary-credit {
  color: #6EE7B7 !important;
}

@media (max-width: 768px) {
  .pn-bg-credits-list { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 3: NGÔN NGỮ — reuse style addon-item + thêm phần riêng
   ============================================================ */
.pn-bg-langs-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* Custom language input */
.pn-bg-lang-custom {
  margin-top: 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1.5px dashed #D1D5DB;
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.pn-bg-lang-custom:focus-within {
  border-color: #1B4F8A;
  border-style: solid;
}

.pn-bg-lang-custom label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.pn-bg-lang-custom input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #FAFAFA;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}

.pn-bg-lang-custom input[type="text"]:focus {
  outline: none;
  border-color: #1B4F8A;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(27, 79, 138, 0.08);
}

.pn-bg-lang-custom-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6B7280;
  font-style: italic;
  line-height: 1.5;
}

/* Note cảnh báo bản dịch */
.pn-bg-lang-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #F59E0B;
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: #78350F;
  line-height: 1.55;
}

@media (max-width: 768px) {
  .pn-bg-langs-list { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 4: TỔNG GIÁ — với breakdown chi tiết
   ============================================================ */
.pn-bg-total-box {
  background: linear-gradient(135deg, #1B4F8A 0%, #143866 100%);
  color: #fff;
  padding: 24px 28px;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(27, 79, 138, 0.25);
  position: sticky;
  top: 80px;
  z-index: 10;
}

/* "Gói đang chọn" — nhấn mạnh */
.pn-bg-summary-pkg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(232, 213, 163, 0.13);
  border: 1px solid rgba(232, 213, 163, 0.35);
  border-radius: 10px;
  margin-bottom: 14px;
}

.pn-bg-summary-icon {
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.pn-bg-summary-pkg .pn-bg-summary-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.pn-bg-summary-pkg .pn-bg-summary-value {
  flex: 1 1 auto;
  text-align: right;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pn-bg-pkg-name-display {
  font-size: 14px;
  color: #E8D5A3;
}

.pn-bg-pkg-price-display {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
}

/* Section addons / langs trong breakdown */
.pn-bg-summary-section {
  margin-bottom: 12px;
}

.pn-bg-summary-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 6px;
}

.pn-bg-summary-list {
  list-style: none;
  padding: 0 0 0 24px;
  margin: 0;
}

.pn-bg-summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  gap: 10px;
}

.pn-bg-summary-list li:last-child {
  border-bottom: none;
}

.pn-bg-summary-name {
  flex: 1 1 auto;
  word-break: break-word;
}

.pn-bg-summary-price {
  flex: 0 0 auto;
  font-weight: 700;
  color: #E8D5A3;
  white-space: nowrap;
}

.pn-bg-quote-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.pn-bg-summary-divider {
  height: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  margin: 14px 0 8px;
}

.pn-bg-quote-note {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.13);
  border-left: 3px solid #FCD34D;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #FCD34D;
  line-height: 1.55;
}

.pn-bg-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.pn-bg-total-row.pn-bg-total-final {
  border-top: 1px dashed rgba(255, 255, 255, 0.25);
  margin-top: 4px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.pn-bg-total-final .pn-bg-total {
  font-size: 26px;
  color: #E8D5A3;
  letter-spacing: -0.5px;
}

.pn-bg-total-note {
  font-size: 12px;
  color: rgba(232, 213, 163, 0.85);
  font-style: italic;
  margin-top: 8px;
  text-align: right;
}

/* ============================================================
   SECTION 5: FORM FIELDS
   ============================================================ */
.pn-bg-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.pn-bg-field-full {
  grid-column: 1 / -1;
}

.pn-bg-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.pn-bg-req {
  color: #EF4444;
  font-weight: 700;
}

.pn-bg-opt {
  color: #6B7280;
  font-weight: 400;
  font-size: 12px;
  font-style: italic;
}

.pn-bg-field input[type="text"],
.pn-bg-field input[type="tel"],
.pn-bg-field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1A1A1A;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.pn-bg-field input:focus {
  outline: none;
  border-color: #1B4F8A;
  box-shadow: 0 0 0 3px rgba(27, 79, 138, 0.1);
}

.pn-bg-field input.is-error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============================================================
   SECTION 5: SUBMIT
   ============================================================ */
.pn-bg-submit-box {
  background: #FAF5E8;
  border: 1.5px dashed #E8D5A3;
  border-radius: 16px;
  padding: 28px 30px;
  text-align: center;
}

.pn-bg-lang-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pn-bg-lang-row label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.pn-bg-lang-row select {
  padding: 8px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}

.pn-bg-turnstile-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 22px;
  min-height: 65px;
}

.pn-bg-submit-btn {
  display: inline-block;
  width: auto !important;
  min-width: 280px;
  padding: 16px 40px !important;
  font-size: 15px !important;
  letter-spacing: 0.5px;
}

.pn-bg-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.pn-bg-submit-note {
  margin-top: 16px !important;
  font-size: 12.5px;
  color: #6B7280;
  font-style: italic;
  line-height: 1.5;
}

/* ============================================================
   THÔNG BÁO
   ============================================================ */
.pn-bg-message {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.pn-bg-message.is-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #B91C1C;
}

.pn-bg-message.is-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .pn-bg-addons-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pn-bg-addon-item { padding: 12px 14px; }

  .pn-bg-fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pn-bg-submit-box { padding: 22px 18px; }
  .pn-bg-submit-btn {
    min-width: 100%;
    padding: 14px 24px !important;
  }

  .pn-bg-total-box {
    padding: 20px 22px;
    position: static;
  }
  .pn-bg-total-final .pn-bg-total { font-size: 24px; }

  .pn-bg-lang-row {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 549px) {
  .pn-bg-section { margin-bottom: 24px; }
}
