/*
Theme Name: Astra Child - Nha xe Khang An
Theme URI: https://nhaxekhangan.com
Description: Giao diện dành riêng cho hệ thống đặt xe Khang An
Version: 1.0.0
Template: astra
*/

/* =============================================
   RESET & BASE
   ============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  font-family: "Inter", "Be Vietnam Pro", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   CSS VARIABLES (KHANG AN PALETTE)
   ============================================= */
:root {
  --ka-orange: #ff6b00; /* Speed - Tốc độ */
  --ka-orange-dark: #cc5500;
  --ka-navy: #0a2540; /* Trust - Uy tín */
  --ka-navy-dark: #051322;
  --white: #ffffff;

  --transition-fast: 0.25s ease;
  --transition-mid: 0.45s ease;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
}

/* =============================================
   HEADER (ELEMENTOR FALLBACK)
   ============================================= */
.elementor-location-header {
  background: var(--ka-navy) !important;
  border-bottom: 2px solid var(--ka-orange) !important;
  box-shadow:
    0 0 20px rgba(255, 107, 0, 0.1),
    var(--shadow-md) !important;
}
.elementor-location-header .e-con,
.elementor-location-header .e-con-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  min-height: unset !important;
}
.elementor-location-header > .e-con {
  min-height: 68px !important;
  max-height: 68px !important;
  align-items: center !important;
}
.elementor-location-header .hfe-nav-menu__item:hover > a {
  box-shadow: 0 -2px 0 0 var(--ka-orange) inset !important;
}
.elementor-location-header .hfe-nav-menu .sub-menu {
  background: var(--ka-navy) !important;
  border-top: 2px solid var(--ka-orange) !important;
}
.elementor-location-header .hfe-nav-menu .sub-menu .menu-item > a:hover {
  color: #ffffff !important;
  background: rgba(255, 107, 0, 0.1) !important;
  padding-left: 22px !important;
}

/* =============================================
   BUTTONS
   ============================================= */
.elementor-button,
.wp-block-button__link {
  background: var(--ka-orange) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast) !important;
}
.elementor-button:hover {
  background: var(--ka-orange-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4) !important;
}

/* =============================================
   SECTION HEADINGS
   ============================================= */
.section-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  color: var(--ka-navy);
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 32px;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52px;
  height: 3px;
  background: var(--ka-orange);
}
.section-title.center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* =============================================
   CARDS
   ============================================= */
.card-hover {
  transition:
    transform var(--transition-mid),
    box-shadow var(--transition-mid);
  border-radius: 8px;
  overflow: hidden;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer,
#colophon,
.elementor-location-footer,
.hfe-footer {
  background: var(--ka-navy) !important;
  color: rgba(255, 255, 255, 0.75);
  border-top: 2px solid var(--ka-orange) !important;
}
.site-footer a,
.elementor-location-footer a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition-fast);
}
.site-footer a:hover,
.elementor-location-footer a:hover {
  color: var(--ka-orange) !important;
}

/* =============================================
   GSAP ANIMATION INIT
   ============================================= */
.gsap-fade-up,
.gsap-fade-left,
.gsap-fade-right,
.gsap-scale-in {
  opacity: 0;
}

/* =============================================
   CONTACT FORM 7
   ============================================= */
.wpcf7-form .wpcf7-text,
.wpcf7-form .wpcf7-email,
.wpcf7-form .wpcf7-tel,
.wpcf7-form .wpcf7-textarea,
.wpcf7-form .wpcf7-select {
  width: 100% !important;
  border: none !important;
  border-bottom: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 12px 0 !important;
  font-size: 15px !important;
  color: #1a1a1a !important;
  outline: none !important;
  transition: border-color 0.3s ease !important;
}
.wpcf7-form .wpcf7-text:focus,
.wpcf7-form .wpcf7-email:focus,
.wpcf7-form .wpcf7-tel:focus,
.wpcf7-form .wpcf7-textarea:focus {
  border-bottom-color: var(--ka-orange) !important;
}
.wpcf7-form input[type="submit"] {
  background: var(--ka-orange) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 14px 40px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition:
    background 0.25s,
    transform 0.25s !important;
}
.wpcf7-form input[type="submit"]:hover {
  background: var(--ka-navy) !important;
  transform: translateY(-2px) !important;
}

/* =============================================
   SCROLL TOP (Trong file style.css)
   ============================================= */
.ast-scroll-top {
  background: var(
    --ka-navy
  ) !important; /* Đổi màu nền thành Navy hoặc Orange tùy ý */
  border-radius: 50% !important; /* Bo tròn 100% giống nút Zalo */
  width: 44px !important;
  height: 44px !important;
  bottom: 30px !important;
  right: 30px !important;
  opacity: 0.85;
  transition:
    opacity 0.2s,
    transform 0.2s !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
.ast-scroll-top:hover {
  opacity: 1;
  background: var(--ka-orange) !important; /* Hover vào thì đổi sang màu Cam */
  transform: translateY(-3px) !important;
}
.ast-scroll-top .ast-icon {
  color: #ffffff !important; /* Màu của cái mũi tên bên trong */
}

/* --- FIX CỐ ĐỊNH & ANIMATE CỤM NÚT LIÊN HỆ --- */
.ka-fixed-contact {
  position: fixed;
  bottom: 90px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: auto; /* Đảm bảo click được */
}

.ka-float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  text-decoration: none !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: 0.3s;
  background: transparent !important; /* ÉP NỀN TRONG SUỐT ĐỂ SỬA LỖI KHUNG TRẮNG */
  padding: 0;
  overflow: visible; /* Đảm bảo animate không bị cắt */
  border: none !important; /* Xóa bỏ border nếu có */
}

.ka-float-btn:hover {
  transform: scale(1.1);
}

/* Nút Zalo - Dùng ảnh */
.ka-float-zalo {
  background: transparent !important;
  border-radius: 50%;
}
.ka-float-zalo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Nút Gọi - Dùng màu cam và hiệu ứng sóng */
.ka-float-call {
  background: var(--orange) !important;
  color: #fff !important;
}

/* Hiệu ứng sóng chỉ cho nút Gọi */
.ka-float-call::before,
.ka-float-call::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--orange);
  z-index: -1;
  animation: kaPulse 2s linear infinite;
  opacity: 0.7;
}
.ka-float-call::after {
  animation-delay: 1s;
}

@keyframes kaPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .ka-fixed-contact {
    bottom: 80px;
    right: 20px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }
}

/* ==========================================================
   KHANG AN - SINGLE POST DETAIL STYLING (THE WOW FACTOR)
============================================================= */

/* 1. Tổng thể độ rộng bài viết - Thu gọn để dễ đọc hơn (Ưu tiên UX) */
.single-post #primary {
  max-width: 1000px;
  margin: 0 auto;
  float: none;
  padding: 0 20px;
}

/* 2. Container nội dung bài viết chính */
.single-post .ast-content-area {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin-top: 50px;
  margin-bottom: 80px;
}

/* 3. Header bài viết (Tiêu đề, Meta) */
.single-post .entry-header {
  text-align: center;
  padding: 60px 5vw 40px;
  border-bottom: 1px solid #eef2f6;
  max-width: 800px; /* Nội dung text header thu gọn */
  margin: 0 auto;
}

/* Tiêu đề chính h1 */
.single-post .entry-title {
  font-family: "Be Vietnam Pro", sans-serif; /* Dùng Be Vietnam cho dễ đọc */
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 800;
  color: #0a2540;
  line-height: 1.25;
  margin-bottom: 15px;
}

/* Meta bài viết (Ngày đăng, Danh mục) */
.single-post .entry-meta {
  font-size: 14px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.single-post .entry-meta a {
  color: #ff6b00 !important;
  font-weight: 700;
}

/* 4. Ảnh đại diện (Featured Image) - Nằm ngoài box content cho "sang" */
.single-post .post-thumb-img-content {
  margin-top: -30px; /* Đẩy lên trên box */
  margin-bottom: 40px;
  text-align: center;
}
.single-post .post-thumb-img-content img {
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* 5. Nội dung bài viết chính ( entry-content ) - THE WOW FACTOR */
.single-post .entry-content {
  max-width: 800px; /* ÉP ĐỘ RỘNG VÀO GIỮA ĐỂ DỄ ĐỌC */
  margin: 0 auto;
  padding: 0 20px 60px;
  font-size: 17px;
  line-height: 1.9; /* Khoảng cách dòng thoáng */
  color: #475569;
}

/* Style các thẻ tiêu đề trong bài viết (H2, H3,...) */
.single-post .entry-content h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #0a2540 !important;
  margin-top: 60px;
  margin-bottom: 25px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Điểm nhấn màu Cam thương hiệu bên cạnh H2 */
.single-post .entry-content h2::before {
  content: "";
  display: block;
  width: 6px;
  height: 30px;
  background: #ff6b00;
  border-radius: 3px;
}

.single-post .entry-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #0a2540 !important;
  margin-top: 40px;
  margin-bottom: 15px;
  border-bottom: 2px dashed #e2e8f0;
  padding-bottom: 10px;
}

/* Style đoạn văn bản */
.single-post .entry-content p {
  margin-bottom: 25px;
}
.single-post .entry-content strong {
  color: #0a2540;
}

/* Style cho danh sách (ul, ol) */
.single-post .entry-content ul,
.single-post .entry-content ol {
  margin-bottom: 25px;
  padding-left: 20px;
}
.single-post .entry-content ul li::marker {
  color: #ff6b00;
}
.single-post .entry-content ol li {
  font-weight: 700;
  color: #0a2540;
}

/* Style ảnh trong bài viết */
.single-post .entry-content img {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}
.single-post .entry-content .wp-caption-text {
  font-size: 14px;
  font-style: italic;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 30px;
}

/* 6. Phần Comment và Related Posts (Nếu có) - Nằm ngoài box content trắng */
.single-post #comments {
  max-width: 800px;
  margin: 50px auto;
  padding: 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

@media (max-width: 992px) {
  .single-post #primary {
    padding: 0 15px;
  }
  .single-post .entry-header {
    padding: 40px 15px 30px;
  }
  .single-post .entry-title {
    font-size: 32px;
  }
  .single-post .entry-content {
    font-size: 16px;
    padding: 0 15px 50px;
  }
  .single-post .entry-content h2 {
    font-size: 30px;
    margin-top: 50px;
  }
}
