/* ═══════════════════════════════════════════════════
   TFAN — Custom CSS (works with Tailwind v4 CDN)
   ═══════════════════════════════════════════════════ */

/* ── WordPress Admin Bar offset ── */
body.admin-bar #masthead { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar #masthead { top: 46px; }
}

/* ── Sticky Header Scroll Shrink ── */
#masthead .max-w-7xl > div {
  height: 5rem !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#masthead.scrolled .max-w-7xl > div {
  height: 4.25rem !important;
}

/* ── Desktop Menu ── */
#site-navigation ul { list-style: none; margin: 0; padding: 0; }
#site-navigation > ul { display: flex; align-items: center; gap: 0.35rem; }
#site-navigation > ul > li > a {
  display: inline-flex; align-items: center; gap: 0.25rem;
  color: #1B2838; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; padding: 0.6rem 0.85rem; border-radius: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* Hover & Active states for level 1 */
#site-navigation > ul > li:not(:last-child) > a:hover,
#site-navigation > ul > li:not(:last-child).current-menu-item > a,
#site-navigation > ul > li:not(:last-child).current-menu-parent > a {
  color: #2DB94D; background-color: #F0FDF4; /* Very soft brand green tint */
}

/* Dropdown Level 1 */
#site-navigation > ul > li { position: relative; }
#site-navigation li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  margin-top: -3px;
  vertical-align: middle;
  transition: transform 0.25s ease-in-out;
}
#site-navigation > ul > li.menu-item-has-children:hover > a::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

#site-navigation ul.sub-menu {
  display: none; position: absolute; top: 100%; left: 0;
  width: 17rem; z-index: 50; padding: 0.65rem 0;
  background: white; border-radius: 0.75rem;
  box-shadow: 0 15px 35px -5px rgba(27,40,56,0.1), 0 5px 15px -3px rgba(0,0,0,0.04);
  border: 1px solid #f3f4f6;
  border-top: 3px solid #2DB94D; /* Elegant top accent line */
  animation: tfan-dropdown-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tfan-dropdown-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#site-navigation > ul > li:hover > ul.sub-menu { display: block; }
#site-navigation ul.sub-menu li { position: relative; }
#site-navigation ul.sub-menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1.25rem; color: #4B5563;
  text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s ease-in-out; border-radius: 0.375rem; margin: 0 0.5rem;
}
#site-navigation ul.sub-menu a:hover {
  background-color: #F0FDF4; color: #2DB94D;
  padding-left: 1.5rem; /* Micro-interaction: elegant horizontal text shift */
}
#site-navigation ul.sub-menu li.current-menu-item > a {
  color: #2DB94D; background-color: #F0FDF4;
  padding-left: 1.5rem;
}

/* Dropdown Level 2+ (flyout right) */
#site-navigation ul.sub-menu ul.sub-menu {
  top: -0.65rem; left: 100%; margin-left: 0.25rem;
}
#site-navigation ul.sub-menu li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); /* Pointing right */
  margin-left: auto;
  margin-right: 0;
  margin-top: 0;
  transition: transform 0.25s ease-in-out;
}
#site-navigation ul.sub-menu li.menu-item-has-children:hover > a::after {
  transform: rotate(45deg);
}
#site-navigation ul.sub-menu li:hover > ul.sub-menu { display: block; }

/* Last menu item = CTA Button (excluding from normal underline hover) */
#site-navigation > ul > li:last-child > a {
  background-color: #2DB94D; color: #fff !important;
  padding: 0.6rem 1.25rem; border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(45, 185, 77, 0.2);
}
#site-navigation > ul > li:last-child > a::after { display: none; }
#site-navigation > ul > li:last-child > a:hover {
  background-color: #1E8F38;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 185, 77, 0.3);
}

/* ── Mobile Sidebar Nav ── */
.tfan-mobile-nav { list-style: none; margin: 0; padding: 0; }
.tfan-mobile-nav li { border-bottom: 1px solid #f9fafb; }
.tfan-mobile-nav li:last-child { border-bottom: none; }
.tfan-mobile-nav > li > a {
  display: block; padding: 0.8rem 1rem; color: #1B2838;
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: all 0.2s ease-in-out; border-radius: 0.5rem;
}
.tfan-mobile-nav > li > a:hover,
.tfan-mobile-nav > li.current-menu-item > a { color: #2DB94D; background-color: #F0FDF4; }

/* Submenu toggle wrapper */
.tfan-mobile-nav li.menu-item-has-children { position: relative; }
.tfan-mobile-nav li.menu-item-has-children > .tfan-submenu-toggle {
  position: absolute; top: 0; right: 0;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #9CA3AF; background: none; border: none;
  transition: all 0.2s; z-index: 2;
}
.tfan-mobile-nav li.menu-item-has-children > .tfan-submenu-toggle:hover { color: #2DB94D; }
.tfan-mobile-nav li.menu-item-has-children > .tfan-submenu-toggle svg {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tfan-mobile-nav li.menu-item-has-children.open > .tfan-submenu-toggle svg {
  transform: rotate(90deg);
}
.tfan-mobile-nav li.menu-item-has-children.open > .tfan-submenu-toggle { color: #2DB94D; }

/* Submenu collapsed */
.tfan-mobile-nav ul.sub-menu {
  list-style: none; margin: 0 0.5rem; padding: 0;
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: #f9fafb; border-radius: 0.5rem; margin-bottom: 0.25rem;
}
.tfan-mobile-nav li.menu-item-has-children.open > ul.sub-menu {
  max-height: 1000px;
}
.tfan-mobile-nav ul.sub-menu a {
  display: block; padding: 0.65rem 1rem 0.65rem 1.75rem; color: #4B5563;
  text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s; border-radius: 0.375rem;
}
.tfan-mobile-nav ul.sub-menu a:hover { color: #2DB94D; background-color: #F0FDF4; }
.tfan-mobile-nav ul.sub-menu li.current-menu-item > a { color: #2DB94D; font-weight: 600; }

/* Level 3 indent */
.tfan-mobile-nav ul.sub-menu ul.sub-menu { background: #f3f4f6; margin-left: 0.75rem; border-radius: 0.375rem; }
.tfan-mobile-nav ul.sub-menu ul.sub-menu a { padding-left: 2.25rem; font-size: 0.8125rem; }

/* ── Footer Menu ── */
footer nav ul { list-style: none; margin: 0; padding: 0; }
footer nav ul li a {
  color: rgba(255,255,255,0.6); text-decoration: none;
  transition: color 0.2s; font-size: 0.875rem;
  display: inline-block; padding: 0.25rem 0;
}
footer nav ul li a:hover { color: #2DB94D; }

/* ── Hero Slider & Text Animations ── */
.tfan-hero { position: relative; overflow: hidden; }
.tfan-hero__slides { display: flex; transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.tfan-hero__slide {
  min-width: 100%; position: relative;
  background-size: cover; background-position: center;
  min-height: 550px;
}
@media (min-width: 768px) { .tfan-hero__slide { min-height: 650px; } }
.tfan-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(27,40,56,0.95) 0%, rgba(27,40,56,0.75) 50%, rgba(27,40,56,0.3) 100%);
}
.tfan-hero__dots {
  display: flex; gap: 0.5rem; justify-content: center;
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
}
.tfan-hero__dot {
  width: 12px; height: 12px; border-radius: 9999px;
  background: rgba(255,255,255,0.35); cursor: pointer;
  transition: all 0.3s ease; border: none;
}
.tfan-hero__dot.active { background: #2DB94D; width: 36px; }
.tfan-hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 9999px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15); color: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 10;
}
.tfan-hero__arrow:hover { background: #2DB94D; border-color: #2DB94D; transform: translateY(-50%) scale(1.05); }
.tfan-hero__arrow--prev { left: 1.5rem; }
.tfan-hero__arrow--next { right: 1.5rem; }

/* Slide Text Reveal Animations */
.tfan-hero__slide .inline-flex,
.tfan-hero__slide h1,
.tfan-hero__slide p,
.tfan-hero__slide .flex {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tfan-hero__slide.active .inline-flex,
.tfan-hero__slide.active h1,
.tfan-hero__slide.active p,
.tfan-hero__slide.active .flex {
  opacity: 1;
  transform: translateY(0);
}
.tfan-hero__slide.active .inline-flex { transition-delay: 0.15s; }
.tfan-hero__slide.active h1 { transition-delay: 0.3s; }
.tfan-hero__slide.active p { transition-delay: 0.45s; }
.tfan-hero__slide.active .flex { transition-delay: 0.6s; }

/* ── Section Headers ── */
.tfan-section-header { text-align: center; margin-bottom: 3.5rem; }
.tfan-section-header h2 {
  font-family: 'Lexend', sans-serif; font-weight: 700;
  font-size: 2rem; color: #1B2838; margin-bottom: 0.75rem;
}
@media (min-width: 768px) { .tfan-section-header h2 { font-size: 2.5rem; } }
.tfan-section-header p { color: #6B7280; max-width: 600px; margin: 0 auto; font-size: 1.05rem; }
.tfan-section-bar {
  width: 80px; height: 3px; background: linear-gradient(90deg, #2DB94D, #E8F8EC);
  border-radius: 999px; margin: 0.85rem auto 0;
  position: relative;
}
.tfan-section-bar::before {
  content: '';
  position: absolute;
  top: 50%; left: 35%;
  width: 6px; height: 6px;
  background: #2DB94D;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: tfan-bar-pulse 2s infinite ease-in-out;
}
@keyframes tfan-bar-pulse {
  0%, 100% { left: 35%; }
  50% { left: 65%; }
}

/* ── Product Card ── */
.tfan-product-card {
  background: white; border-radius: 1rem; overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(27,40,56,0.04), 0 2px 6px -1px rgba(0,0,0,0.02);
  border: 1px solid #f3f4f6; transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.tfan-product-card:hover {
  box-shadow: 0 20px 40px -10px rgba(27,40,56,0.12), 0 4px 12px -2px rgba(0,0,0,0.03);
  transform: translateY(-6px); border-color: rgba(45,185,77,0.25);
}
.tfan-product-card img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.tfan-product-card:hover img {
  transform: scale(1.06);
}
.tfan-product-card__badge {
  position: absolute; top: 0.85rem; left: 0.85rem; z-index: 5;
  padding: 0.3rem 0.85rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.tfan-product-card__badge--new { background: linear-gradient(135deg, #2DB94D 0%, #1E8F38 100%); color: white; }
.tfan-product-card__badge--hot { background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%); color: white; }
.tfan-product-card__badge--promo { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); color: white; }

/* ── Partners Carousel ── */
.tfan-partners-track {
  display: flex; gap: 2rem; animation: tfan-scroll 25s linear infinite;
}
.tfan-partners-track:hover { animation-play-state: paused; }
@keyframes tfan-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Counter Animation ── */
.tfan-counter { transition: all 0.3s; }

/* ── Scroll Reveal ── */
.tfan-reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.tfan-reveal.revealed { opacity: 1; transform: translateY(0); }
.tfan-reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.tfan-reveal-left.revealed { opacity: 1; transform: translateX(0); }
.tfan-reveal-right { opacity: 0; transform: translateX(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.tfan-reveal-right.revealed { opacity: 1; transform: translateX(0); }

/* ── Floating Buttons ── */
.tfan-floating {
  position: fixed; bottom: 6rem; right: 1.5rem; z-index: 40;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.tfan-floating__btn {
  width: 52px; height: 52px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  color: white; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: all 0.3s; text-decoration: none;
  animation: tfan-pulse 2s infinite;
}
.tfan-floating__btn:hover { transform: scale(1.1); }
.tfan-floating__btn--phone { background: #2DB94D; }
.tfan-floating__btn--zalo { background: #0068FF; }
.tfan-floating__btn--messenger { background: #0084FF; }
@keyframes tfan-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45,185,77,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(45,185,77,0); }
}

/* ── Modal ── */
.tfan-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.tfan-modal.active { display: flex; }
.tfan-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.tfan-modal__content {
  position: relative; background: white; border-radius: 1rem;
  max-width: 540px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: tfan-modal-in 0.3s ease;
}
@keyframes tfan-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Lightbox ── */
.tfan-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.9); display: none;
  align-items: center; justify-content: center;
}
.tfan-lightbox.active { display: flex; }
.tfan-lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 0.5rem; }

/* ── FluentForm Overrides ── */
.fluentform .ff-el-form-control {
  padding: 0.75rem 1rem !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
  font-size: 0.9rem !important;
  transition: all 0.2s !important;
}
.fluentform .ff-el-form-control:focus {
  border-color: #2DB94D !important;
  box-shadow: 0 0 0 3px rgba(45,185,77,0.15) !important;
  outline: none !important;
}
.fluentform .ff-btn-submit {
  background-color: #2DB94D !important;
  color: white !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.5rem !important;
  font-weight: 600 !important;
  border: none !important;
  transition: all 0.2s !important;
  cursor: pointer !important;
}
.fluentform .ff-btn-submit:hover {
  background-color: #1E8F38 !important;
}

/* ── WooCommerce Tabs Override ── */
.woocommerce-tabs .tabs { list-style: none; display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin: 0; padding: 0; }
.woocommerce-tabs .tabs li a {
  display: block; padding: 0.75rem 1.5rem; color: #6B7280;
  text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
}
.woocommerce-tabs .tabs li.active a { color: #2DB94D; border-bottom-color: #2DB94D; }

/* ── Pagination ── */
.page-numbers { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
.page-numbers a, .page-numbers span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 0.5rem; text-decoration: none;
  font-weight: 500; font-size: 0.9rem; transition: all 0.2s;
}
.page-numbers a { background: white; color: #374151; border: 1px solid #e5e7eb; }
.page-numbers a:hover { background: #E8F8EC; color: #2DB94D; border-color: #2DB94D; }
.page-numbers .current { background: #2DB94D; color: white; border: none; }

/* ── Timeline ── */
.tfan-timeline { position: relative; padding-left: 2rem; }
.tfan-timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(to bottom, #2DB94D, #E8F8EC);
  border-radius: 2px;
}
.tfan-timeline__item { position: relative; padding-bottom: 2rem; }
.tfan-timeline__dot {
  position: absolute; left: -2.35rem; top: 0.25rem;
  width: 14px; height: 14px; border-radius: 9999px;
  background: #2DB94D; border: 3px solid white;
  box-shadow: 0 0 0 2px #2DB94D;
}
