/* ==========================================================================
   SMART LEAD POPUP & MOBILE BANNER - FRONTEND CSS
   - Desktop: Modal 720x450 (Nền mờ đen 50%)
   - Mobile: Banner đáy <= 160px (Không nền mờ, không đè nút nổi Hotline/Zalo)
   ========================================================================== */

:root {
  --wplp-primary: #2563eb;
  --wplp-primary-hover: #1d4ed8;
  --wplp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wplp-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--wplp-font);
  -webkit-font-smoothing: antialiased;
}

.wplp-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* 1. Backdrop Desktop (Nền phủ đen 50%) */
.wplp-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 2. Modal Desktop: 780x460 (Bố cục chuẩn mẫu thiết kế) */
.wplp-container {
  position: relative;
  z-index: 2;
  width: 780px;
  height: 460px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.wplp-overlay.is-active .wplp-container {
  transform: scale(1) translateY(0);
}

/* Nút Đóng (X) */
.wplp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

.wplp-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}

/* Cột Ảnh trái (400x460) */
.wplp-image-col {
  width: 400px;
  flex: 0 0 400px;
  height: 100%;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.wplp-image-col img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: left center !important; /* Căn từ cạnh trái: giữ trọn vẹn tháp Thượng Hải, cờ TQ, hộ chiếu và chuyên viên */
  display: block !important;
}

.wplp-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* Cột Nội Dung phải (360x450, padding 28px 32px) */
.wplp-content-col {
  width: 360px !important;
  flex: 1 !important;
  height: 100% !important;
  padding: 28px 32px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  background: #ffffff !important;
}

.wplp-title {
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  margin: 0 0 10px 0 !important;
  letter-spacing: -0.01em !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.wplp-title-blue {
  color: #00478f !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  display: block !important;
}

.wplp-title-red {
  color: #e11b22 !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  display: block !important;
}

.wplp-desc {
  font-size: 0.86rem !important;
  color: #475569 !important;
  line-height: 1.45 !important;
  margin: 0 0 16px 0 !important;
  display: block !important;
}

/* Form Styles */
.wplp-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Input Wrappers with Icons */
.wplp-input-wrap {
  position: relative !important;
  width: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.wplp-input-icon {
  position: absolute !important;
  top: 50% !important;
  left: 14px !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #64748b !important;
  pointer-events: none !important;
  z-index: 5 !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wplp-input-icon svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  stroke: #64748b !important;
}

.wplp-input {
  width: 100% !important;
  height: 46px !important;
  padding: 0 14px 0 44px !important;
  border: 1.5px solid #dbe2ea !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  color: #1e293b !important;
  background: #ffffff !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
  display: block !important;
  margin: 0 !important;
}

.wplp-input::placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

.wplp-input:focus {
  border-color: #00478f !important;
  box-shadow: 0 0 0 3px rgba(0, 71, 143, 0.12) !important;
}

/* Primary Submit Button: Red Gradient + Calendar + Arrow */
.wplp-btn-submit {
  width: 100% !important;
  height: 46px !important;
  background: linear-gradient(135deg, #e11b22 0%, #c81017 100%) !important;
  background-color: #e11b22 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-shadow: 0 6px 18px rgba(225, 27, 34, 0.35) !important;
  transition: all 0.2s ease !important;
  margin-top: 2px !important;
  font-family: inherit !important;
  text-decoration: none !important;
}

.wplp-btn-submit svg {
  stroke: #ffffff !important;
}

.wplp-btn-submit:hover {
  background: linear-gradient(135deg, #d3151c 0%, #b30e14 100%) !important;
  box-shadow: 0 8px 22px rgba(225, 27, 34, 0.45) !important;
  transform: translateY(-1px) !important;
}

.wplp-btn-submit:active {
  transform: translateY(0) !important;
}

/* Secondary Button: Hotline with Navy Outline + Red Phone */
.wplp-btn-hotline {
  width: 100% !important;
  height: 44px !important;
  background: #ffffff !important;
  color: #00478f !important;
  border: 1.5px solid #00478f !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  margin: 0 !important;
}

.wplp-btn-hotline svg {
  stroke: #e11b22 !important;
}

.wplp-btn-hotline span {
  color: #00478f !important;
  font-weight: 700 !important;
}

.wplp-btn-hotline:hover {
  background: #f0f7ff !important;
  border-color: #003770 !important;
  color: #003770 !important;
}

.wplp-dismiss-link {
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  padding: 6px !important;
  margin-top: 2px !important;
  transition: color 0.2s ease !important;
  text-align: center !important;
  font-family: inherit !important;
  display: block !important;
  width: 100% !important;
}

.wplp-dismiss-link:hover {
  color: #475569 !important;
  text-decoration: underline !important;
}

.wplp-mobile-actions {
  display: none;
}

.wplp-success-state {
  display: none;
  text-align: center;
  padding: 20px 10px;
}

.wplp-check-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.wplp-success-state h4 {
  font-size: 1.2rem;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.wplp-success-state p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   TABLET: 640x400 (ảnh 320x400)
   ========================================================================== */
@media (max-width: 991px) and (min-width: 768px) {
  .wplp-container {
    width: 640px;
    height: 400px;
  }
  .wplp-image-col {
    width: 300px;
  }
  .wplp-content-col {
    padding: 24px;
  }
  .wplp-title {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   MOBILE: BỐ CỤC 1 CỘT CANH GIỮA MÀN HÌNH (ẢNH CHỮ NHẬT ĐỨNG Ở TRÊN)
   ========================================================================== */
@media (max-width: 767px) {
  .wplp-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center; /* Canh giữa màn hình theo chiều dọc */
    padding: 16px;
    z-index: 999999;
    box-sizing: border-box;
  }

  /* Nền phủ mờ đen nhẹ tập trung chú ý */
  .wplp-backdrop {
    display: block !important;
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  /* Container 1 Cột canh giữa màn hình */
  .wplp-container {
    pointer-events: auto;
    width: 100%;
    max-width: 340px;
    height: auto;
    max-height: 90vh;
    border-radius: 20px;
    b  .wplp-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  .wplp-container {
    width: 100% !important;
    max-width: 360px !important;
    height: auto !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 18px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    background: #ffffff !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
    margin: auto !important;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .wplp-overlay.is-active .wplp-container {
    transform: scale(1) translateY(0);
  }

  /* Nút đóng nổi bật ở góc trên */
  .wplp-close {
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    z-index: 30 !important;
    backdrop-filter: blur(4px) !important;
  }

  .wplp-close:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
  }

  /* Phía trên: Hình banner hiển thị trọn vẹn từ đỉnh đầu xuống */
  .wplp-image-col {
    width: 100% !important;
    height: 195px !important;
    min-height: 195px !important;
    max-height: 205px !important;
    flex: 0 0 195px !important;
    background: #e2e8f0 !important;
    position: relative !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    overflow: hidden !important;
    display: block !important;
  }

  .wplp-image-col img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: left top !important; /* Căn góc trái trên để thấy trọn vẹn tháp, cờ, khuôn mặt và cử chỉ tay */
    border-radius: 0 !important;
    display: block !important;
  }

  .wplp-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: rgba(15, 23, 42, 0.75) !important;
    color: #ffffff !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    backdrop-filter: blur(4px) !important;
    display: block !important;
  }

  /* Phía dưới: Nội dung & Form tư vấn */
  .wplp-content-col {
    width: 100% !important;
    padding: 14px 16px 16px 16px !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  .wplp-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.15 !important;
    max-width: 100% !important;
  }

  .wplp-title-blue,
  .wplp-title-red {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
  }

  .wplp-desc {
    display: block !important;
    font-size: 0.78rem !important;
    color: #64748b !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.35 !important;
  }

  /* Form nhập trên Mobile */
  .wplp-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  .wplp-input-icon {
    left: 12px !important;
    width: 16px !important;
    height: 16px !important;
  }

  .wplp-input-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .wplp-input {
    height: 40px !important;
    padding: 0 12px 0 38px !important;
    font-size: 0.88rem !important;
    border-radius: 8px !important;
  }

  .wplp-btn-submit {
    height: 42px !important;
    font-size: 0.92rem !important;
    border-radius: 8px !important;
    margin-top: 2px !important;
  }

  .wplp-btn-hotline {
    height: 40px !important;
    font-size: 0.88rem !important;
    border-radius: 8px !important;
    margin: 0 !important;
  }

  .wplp-dismiss-link {
    display: block !important;
    font-size: 0.8rem !important;
    padding: 4px !important;
    margin-top: 2px !important;
  }

  .wplp-mobile-actions {
    display: none !important;
  }

  .wplp-mobile-quick-form {
    display: none !important;
  }
}
