/**
 * TGWV Builder — Form liên hệ (contact_form + contact_info)
 * Card trắng trên nền section xám (#f8f9fa) — đặt màu nền section trong Page Builder.
 */

.tgwv-contact-card {
  background: var(--tgwv-cf-card-bg, var(--tgwv-color-light));
  border-radius: 8px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 32px 36px;
  box-sizing: border-box;
  height: 100%;
}

.tgwv-contact-form--plain.tgwv-contact-card,
.tgwv-contact-card.tgwv-contact-form--plain,
.tgwv-contact-info--plain.tgwv-contact-card,
.tgwv-contact-card.tgwv-contact-info--plain {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 767.98px) {
  .tgwv-contact-card {
    padding: 24px 20px;
  }
}

/* —— Form —— */
.tgwv-contact-form__wrap--with-map {
  width: 100%;
}

.tgwv-contact-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  width: 100%;
}

.tgwv-contact-form__wrap--map-left .tgwv-contact-form__layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.tgwv-contact-form__wrap--map-left .tgwv-contact-form__form-col {
  order: 2;
}

.tgwv-contact-form__wrap--map-left .tgwv-contact-form__map {
  order: 1;
}

.tgwv-contact-form__wrap--map-bottom .tgwv-contact-form__layout {
  grid-template-columns: 1fr;
}

.tgwv-contact-form__form-col {
  min-width: 0;
}

.tgwv-contact-form__wrap--with-map .tgwv-contact-card {
  width: 100%;
  height: 100%;
}

.tgwv-contact-form__map {
  min-width: 0;
  min-height: var(--tgwv-cf-map-min-height, 420px);
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f5;
}

.tgwv-contact-form__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: var(--tgwv-cf-map-min-height, 420px);
  border: 0;
}

@media (max-width: 991.98px) {
  .tgwv-contact-form__layout {
    grid-template-columns: 1fr;
  }
}

.tgwv-contact-form {
  --tgwv-cf-title: var(--tgwv-brand, #000000);
  --tgwv-cf-btn: var(--tgwv-brand, #000000);
  --tgwv-cf-icon: var(--tgwv-brand, #000000);
  --tgwv-cf-border: #dee2e6;
  --tgwv-cf-text: var(--tgwv-color-dark, #000000);
  --tgwv-cf-muted: #6c757d;
  --tgwv-cf-req: #dc3545;
  --tgwv-cf-align: left;
  --tgwv-cf-align-flex: flex-start;
  --tgwv-cf-btn-align-flex: flex-end;
  --tgwv-cf-card-bg: var(--tgwv-color-light);
  text-align: var(--tgwv-cf-align, left);
}

.tgwv-contact-form__heading {
  display: flex;
  align-items: center;
  justify-content: var(--tgwv-cf-align-flex, flex-start);
  gap: 10px;
  margin: 0 0 24px;
  text-align: var(--tgwv-cf-align, left);
}

.tgwv-contact-form__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 1.15em;
  line-height: 1;
  color: var(--tgwv-cf-icon, var(--tgwv-brand, #000000));
}

.tgwv-contact-form__title,
.tgwv-contact-info__title {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tgwv-cf-title, var(--tgwv-brand, #000000));
}

.tgwv-contact-form__heading .tgwv-contact-form__title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.tgwv-contact-info__title {
  color: var(--tgwv-ci-title, var(--tgwv-brand, #000000));
  text-align: var(--tgwv-ci-align, left);
}

.tgwv-contact-form__inner {
  margin: 0;
}

.tgwv-contact-form__field {
  margin-bottom: 18px;
}

.tgwv-contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

@media (max-width: 575.98px) {
  .tgwv-contact-form__row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.tgwv-contact-form__label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tgwv-cf-text);
  text-align: var(--tgwv-cf-align, left);
}

.tgwv-contact-form__req {
  color: var(--tgwv-cf-req);
}

.tgwv-contact-form__input,
.tgwv-contact-form__textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tgwv-cf-text);
  text-align: left;
  background: var(--tgwv-color-light);
  border: 1px solid var(--tgwv-cf-border);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tgwv-contact-form__input:focus,
.tgwv-contact-form__textarea:focus {
  outline: none;
  border-color: var(--tgwv-cf-btn, var(--tgwv-brand, #000000));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tgwv-cf-btn, var(--tgwv-brand, #000000)) 12%, transparent);
}

.tgwv-contact-form__input.is-invalid,
.tgwv-contact-form__textarea.is-invalid {
  border-color: var(--tgwv-cf-req);
}

.tgwv-contact-form__textarea {
  min-height: 140px;
  resize: vertical;
}

.tgwv-contact-form__actions {
  display: flex;
  flex-direction: column;
  align-items: var(--tgwv-cf-btn-align-flex, flex-end);
  gap: 12px;
  margin-top: 8px;
}

.tgwv-contact-form__actions--stretch .tgwv-contact-form__btn {
  width: 100%;
}

.tgwv-contact-form__msg {
  width: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  display: none;
}

.tgwv-contact-form__msg.is-visible {
  display: block;
}

.tgwv-contact-form__msg.is-success {
  color: #198754;
}

.tgwv-contact-form__msg.is-error {
  color: var(--tgwv-cf-req);
}

.tgwv-contact-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 160px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tgwv-color-light, #ffffff);
  background-color: var(--tgwv-cf-btn, var(--tgwv-brand, #000000));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, background-color 0.2s ease;
}

.tgwv-contact-form__btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.tgwv-contact-form__btn:hover:not(:disabled) {
  opacity: 0.92;
}

.tgwv-contact-form__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.tgwv-contact-form__btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--tgwv-color-light, #ffffff);
  border-radius: 50%;
  animation: tgwv-cf-spin 0.7s linear infinite;
}

.tgwv-contact-form.is-loading .tgwv-contact-form__btn-spinner {
  display: inline-block;
}

.tgwv-contact-form.is-loading .tgwv-contact-form__btn-label {
  opacity: 0.85;
}

@keyframes tgwv-cf-spin {
  to {
    transform: rotate(360deg);
  }
}

.tgwv-contact-form__field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--tgwv-cf-req);
}

.tgwv-contact-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* —— Info —— */
.tgwv-contact-info {
  --tgwv-ci-title: var(--tgwv-brand, #000000);
  --tgwv-ci-icon: var(--tgwv-brand, #000000);
  --tgwv-ci-border: #dee2e6;
  --tgwv-ci-text: var(--tgwv-color-dark, #000000);
  --tgwv-ci-align: left;
  --tgwv-ci-align-flex: flex-start;
  --tgwv-ci-card-bg: var(--tgwv-color-light);
  text-align: var(--tgwv-ci-align, left);
}

.tgwv-contact-info.tgwv-contact-card {
  background: var(--tgwv-ci-card-bg, var(--tgwv-color-light));
}

.tgwv-contact-info__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tgwv-contact-info__item {
  display: flex;
  align-items: flex-start;
  justify-content: var(--tgwv-ci-align-flex, flex-start);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--tgwv-ci-border);
}

.tgwv-contact-info__item:first-child {
  padding-top: 4px;
}

.tgwv-contact-info__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Multi-line rows (hours / address): keep icon vertically centered to the text block */
.tgwv-contact-info__item--multiline {
  align-items: center;
}

.tgwv-contact-info__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: calc(14px * 1.6);
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--tgwv-ci-icon, var(--tgwv-brand, #000000));
  text-align: center;
}

.tgwv-contact-info--icon-circle .tgwv-contact-info__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 15px;
  color: var(--tgwv-color-light, #ffffff);
  background: var(--tgwv-ci-icon, var(--tgwv-brand, #000000));
}

.tgwv-contact-info--icon-circle .tgwv-contact-info__item {
  align-items: center;
}

.tgwv-contact-info__text {
  flex: 1 1 auto;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tgwv-ci-text);
}

.tgwv-contact-info__item:not(.tgwv-contact-info__item--multiline) .tgwv-contact-info__text {
  align-self: center;
}

.tgwv-contact-info__text--pre {
  white-space: pre-line;
  line-height: 1.3;
}

.tgwv-contact-info__link {
  color: inherit;
  text-decoration: none;
}

.tgwv-contact-info__link:hover {
  color: var(--tgwv-ci-icon);
  text-decoration: underline;
}

.tgwv-contact-info__item--empty .tgwv-contact-info__text {
  color: #6c757d;
  font-style: italic;
}

/* Modal thành công — đóng sẽ reload trang */
.tgwv-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.tgwv-contact-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 24px;
  border-radius: 12px;
  background-color: var(--tgwv-color-light);
  color: #1e293b;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  animation: tgwvContactModalIn 0.28s ease-out;
}

@keyframes tgwvContactModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tgwv-contact-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tgwv-contact-modal__close:hover,
.tgwv-contact-modal__close:focus-visible {
  background-color: #f1f5f9;
  color: #0f172a;
  outline: none;
}

.tgwv-contact-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--tgwv-cf-btn, var(--tgwv-brand, #000000));
}

.tgwv-contact-modal__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.tgwv-contact-modal__message {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: #475569;
}

.tgwv-contact-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  background-color: var(--tgwv-cf-btn, var(--tgwv-brand, #000000));
  color: var(--tgwv-color-light, #ffffff);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tgwv-contact-modal__btn:hover {
  opacity: 0.92;
}

.tgwv-contact-modal__btn:focus-visible {
  outline: 2px solid var(--tgwv-cf-btn, var(--tgwv-brand, #000000));
  outline-offset: 3px;
}

body.tgwv-contact-modal--open {
  overflow: hidden;
}
