/* ============================================= */
/* CUSTOM STYLES - FBA Website                   */
/* ============================================= */

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Chặn tràn ngang bằng overflow-x: clip (không dùng hidden): hidden trên cả html lẫn body biến body
   thành vùng cuộn riêng, làm header sticky trôi mất khi cuộn. */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  max-width: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
  position: relative;
}

/* ============================================= */
/* HEADER STYLES                                 */
/* ============================================= */

/* Header shrink on scroll */
#main-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#main-header.scrolled .py-3 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#main-header.scrolled img {
  height: 2.75rem;
}

/* Dropdown menu animation */
.dropdown-menu {
  transform: translateY(8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover .dropdown-menu {
  transform: translateY(0);
}

/* Nav link active state */
.nav-link.active {
  position: relative;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background-color: #B51E21;
  border-radius: 2px;
}

/* Mobile accordion */
.accordion-toggle svg {
  transition: transform 0.3s ease;
}

.accordion-toggle.active svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.accordion-content.show {
  display: block;
  max-height: 500px;
  padding-bottom: 0.5rem;
}

/* ============================================= */
/* HERO SECTION                                  */
/* ============================================= */

#hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(249, 201, 113, 0.08);
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* ============================================= */
/* CARD HOVER EFFECTS                            */
/* ============================================= */

article.group:hover {
  transform: translateY(-4px);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================= */
/* PARTNER LOGOS                                 */
/* ============================================= */

.partner-logo {
  transition: all 0.3s ease;
  filter: grayscale(30%);
  opacity: 0.7;
}

.partner-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* ============================================= */
/* BACK TO TOP BUTTON                            */
/* ============================================= */

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-3px);
}

/* ============================================= */
/* SCROLL REVEAL ANIMATIONS                      */
/* ============================================= */

[data-sr] {
  visibility: visible;
}

/* ============================================= */
/* CUSTOM SCROLLBAR (VERTICAL ONLY)              */
/* ============================================= */

::-webkit-scrollbar {
  width: 8px;
  height: 0px !important;
}

::-webkit-scrollbar:horizontal,
::-webkit-scrollbar-thumb:horizontal,
::-webkit-scrollbar-track:horizontal,
::-webkit-scrollbar-corner:horizontal,
::-webkit-scrollbar-button:horizontal,
::-webkit-scrollbar-button {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

::-webkit-scrollbar-track:vertical {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb:vertical {
  background: #B51E21;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:vertical:hover {
  background: #D71D23;
}

/* ============================================= */
/* LOADING ANIMATION                             */
/* ============================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================= */
/* SECTION DIVIDERS                              */
/* ============================================= */

.section-divider {
  position: relative;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #B51E21, #F9C971);
  border-radius: 2px;
}

/* ============================================= */
/* RESPONSIVE ADJUSTMENTS                        */
/* ============================================= */

/* Mobile Menu overlay */
@media (max-width: 1023px) {
  #mobile-menu {
    border-top: 3px solid #B51E21;
  }
}

/* Tablet specific */
@media (min-width: 768px) and (max-width: 1023px) {
  #hero h1 {
    font-size: 2.5rem;
  }
}

/* Desktop large */
@media (min-width: 1280px) {
  .nav-link {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Mobile small */
@media (max-width: 480px) {
  #hero h1 {
    font-size: 1.75rem;
  }

  #hero p {
    font-size: 0.875rem;
  }

  .font-phudu.text-3xl {
    font-size: 1.5rem;
  }
}

/* ============================================= */
/* FOCUS STYLES (Accessibility)                  */
/* ============================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #B51E21;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================= */
/* SELECTION STYLING                             */
/* ============================================= */

::selection {
  background-color: #B51E21;
  color: white;
}

::-moz-selection {
  background-color: #B51E21;
  color: white;
}

/* ============================================= */
/* PRINT STYLES                                  */
/* ============================================= */

@media print {
  #top-bar,
  #main-header,
  #back-to-top,
  #mobile-menu {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    text-decoration: underline;
  }
}

/* Chặn tràn ngang do hiệu ứng trượt (ScrollReveal) – clip không tạo vùng cuộn nên không ảnh hưởng header sticky */
body {
  overflow-x: clip;
}

/* =============================================
   FOOTER XANH LÁ (Hoàng Hà Green - #0C765F)
   ============================================= */
.fba-footer,
footer#main-footer {
  background: linear-gradient(180deg, #0C765F 0%, #00483D 100%) !important;
  padding-top: 3.5rem !important; /* Đảm bảo khoảng cách thở 56px phía trên cho logo & tiêu đề */
}
.fba-footer .text-gray-400,
footer#main-footer .text-gray-400 { color: rgba(255, 255, 255, .85) !important; }
.fba-footer .text-gray-500,
footer#main-footer .text-gray-500 { color: rgba(255, 255, 255, .65) !important; }
.fba-footer .border-white\/10,
footer#main-footer .border-white\/10 { border-color: rgba(255, 255, 255, .15) !important; }
.fba-footer .border-white\/20,
footer#main-footer .border-white\/20 { border-color: rgba(255, 255, 255, .25) !important; }
.fba-footer .bg-white\/10,
footer#main-footer .bg-white\/10 { background-color: rgba(255, 255, 255, .15) !important; }
.fba-footer input,
footer#main-footer input {
  background-color: rgba(255, 255, 255, .15) !important;
  border-color: rgba(255, 255, 255, .25) !important;
  color: #ffffff !important;
}
.fba-footer input::placeholder,
footer#main-footer input::placeholder { color: rgba(255, 255, 255, .65) !important; }
.fba-footer input:focus,
footer#main-footer input:focus {
  background-color: rgba(255, 255, 255, .22) !important;
  border-color: #FADA8E !important;
}
/* Nút Đăng ký: Giữ màu đỏ FBA nhận diện thương hiệu chuẩn, viền và shadow nổi bật */
.fba-footer .bg-fba-red,
footer#main-footer .bg-fba-red,
.fba-footer button[type="submit"] {
  background-color: #A81C1D !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
  transition: all 0.2s ease !important;
}
.fba-footer .bg-fba-red:hover,
footer#main-footer .bg-fba-red:hover,
.fba-footer button[type="submit"]:hover,
.fba-footer .hover\:bg-fba-red-light:hover,
footer#main-footer .hover\:bg-fba-red-light:hover {
  background-color: #C8102E !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) !important;
}
.fba-footer a:hover .bg-white\/10,
footer#main-footer a:hover .bg-white\/10,
.fba-footer .hover\:bg-fba-red:hover,
footer#main-footer .hover\:bg-fba-red:hover {
  background-color: #A81C1D !important;
  color: #FFFFFF !important;
}
.fba-footer .text-fba-gold,
footer#main-footer .text-fba-gold {
  color: #FADA8E !important;
  font-weight: 700 !important;
}
.fba-footer a:hover,
footer#main-footer a:hover {
  color: #FADA8E !important;
}
/* Nút lên đầu trang: viền trắng để nổi rõ khi nằm trên footer */
#back-to-top { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 8px 20px rgba(0, 0, 0, .25); }

/* Hero slider: ẩn banner phụ ngay từ đầu (trước khi fba-home.js chạy) để không chồng chữ */
.fba-hero-slide { opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.fba-hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease, visibility 0s; }

/* Header: Be Vietnam Pro, chỉ viết hoa chữ cái đầu (Phudu chỉ có chữ in hoa nên không dùng ở đây) */
#top-bar,
#main-header #desktop-nav,
#main-header #desktop-nav a,
#main-header .dropdown-menu a,
#main-header #mobile-menu,
#main-header #mobile-menu a,
#main-header a[href*="dang-ky-thanh-vien"] {
  font-family: 'Be Vietnam Pro', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
#main-header #desktop-nav .nav-link { font-size: 15px; font-weight: 600; }
#main-header a[href*="dang-ky-thanh-vien"] { white-space: nowrap; }
@media (max-width: 1279px) {
  #main-header #desktop-nav .nav-link { font-size: 13.5px; padding-left: .4rem; padding-right: .4rem; }
  #main-header a.hidden.lg\:inline-flex[href*="dang-ky-thanh-vien"] { padding-left: 1rem; padding-right: 1rem; }
}
#main-header .dropdown-menu a { font-size: 15px; font-weight: 500; }
#main-header #mobile-menu a { font-size: 16px; }

/* ============================================= */
/* PARTNER HORIZONTAL SCROLL TRACK               */
/* ============================================= */
.partner-scroll-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.partner-scroll-container {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.no-scrollbar::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.no-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }

/* ============================================= */
/* TABS & FILTER BUTTONS CONTRAST FIX            */
/* ============================================= */
.mn-tab[aria-selected="true"],
.mn-tab[aria-selected="true"]:hover,
.skct-main-tab.bg-fba-red,
.skct-main-tab.bg-fba-red:hover,
.skct-filter-tag.bg-fba-red,
.skct-filter-tag.bg-fba-red:hover {
  background-color: #B51E21 !important;
  color: #ffffff !important;
  border-color: #B51E21 !important;
}

.mn-tab[aria-selected="false"]:hover,
.skct-main-tab:not(.bg-fba-red):hover,
.skct-filter-tag:not(.bg-fba-red):hover {
  color: #B51E21 !important;
}


/* ============================================= */
/* SLIDER TRACK DRAG & SCROLL AFFORDANCE         */
/* ============================================= */
.fba-track, #skct-track, .store-track, .partner-scroll-container, [data-track], [data-pt-track], [data-aw-track], [data-store-track] {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.fba-track::-webkit-scrollbar,
#skct-track::-webkit-scrollbar,
.store-track::-webkit-scrollbar,
.partner-scroll-container::-webkit-scrollbar,
[data-track]::-webkit-scrollbar,
[data-pt-track]::-webkit-scrollbar,
[data-aw-track]::-webkit-scrollbar,
[data-store-track]::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.fba-track:active, #skct-track:active, .store-track:active,
.fba-track.is-dragging, #skct-track.is-dragging, .store-track.is-dragging {
  cursor: grabbing !important;
}

/* Editable text that visitors do not see (e.g. a Zalo group's long description, shown in its popup):
   visible while an admin is in edit mode. */
body.client-edit-active .fba-edit-show { display: block !important; }
