/* ==========================================================================
   DÂN CHỦ ELECTRIC - STYLES & DYNAMIC ANIMATIONS
   Modern, Rich Aesthetics for Industrial Electrical Engineering
   ========================================================================== */

:root {
  --color-primary: #114d9d;
  --color-primary-dark: #0c3875;
  --color-primary-light: #1e63c2;
  --color-accent: #fbd30b;
  --color-accent-dark: #e2bd06;
  --color-accent-red: #E63917;
  --color-dark: #0f172a;
  --color-body: #334155;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

body {
  font-size: 1rem;
  color: var(--color-body);
  background-color: #f8fafc;
  line-height: 1.65;
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   1. CUSTOM SCROLLBAR
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* --------------------------------------------------------------------------
   2. HEADING DECORATIONS & ACCENTS
   -------------------------------------------------------------------------- */
.heading-line {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}
.heading-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3.5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
}
.heading-line.center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --------------------------------------------------------------------------
   3. STICKY HEADER & NAVBAR GLASSMORPHISM
   -------------------------------------------------------------------------- */
#sticky-header-nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
}
#sticky-header-nav .client-header {
  position: relative;
}
#sticky-header-nav.is-scrolled {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.16), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
}
#sticky-header-nav.is-scrolled .client-header > div {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}
#sticky-header-nav.is-scrolled .client-header .max-w-7xl.py-3 {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
#sticky-header-nav.is-scrolled #main-navbar ul > li.py-4 {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
header.sticky {
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
header.header-scrolled {
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
}
header.header-scrolled .max-w-7xl.py-3 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Nav Dropdown Menu Animation */
.group:hover .group-hover\:block {
  display: block;
  animation: dropdown-slide-down 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdown-slide-down {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   4. HERO BANNER SLIDER (Matching pqs.vn FlexSlider)
   -------------------------------------------------------------------------- */
.banner-container,
.slider-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  background-color: #0b1120;
}

.slides-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
}

.slide,
.slide-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s;
  z-index: 1;
}

.slide.active,
.slide-item.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slide > img,
.slide > picture > img,
.slide-item > img,
.slide-item > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
  transform: none;
}

.slide .slide-card-icon {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain !important;
  display: inline-block !important;
  flex-shrink: 0;
}

.slide.active > img,
.slide.active > picture > img,
.slide-item.active > img,
.slide-item.active > picture > img {
  transform: none;
}

/* Slider Prev / Next Buttons */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 46px;
  height: 46px;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 18px;
  backdrop-filter: blur(6px);
  user-select: none;
}

.slider-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 20px rgba(17, 77, 157, 0.6);
}

.slider-btn.prev {
  left: 20px;
}

.slider-btn.next {
  right: 20px;
}

/* Slider Indicators (Dots) */
.slider-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 20;
  pointer-events: auto;
}

/* Mobile responsive banner: unobstructed image on top + clean info card below */
@media (max-width: 639px) {
  .slides-wrapper {
    aspect-ratio: auto !important;
    height: 300px !important;
  }
  .slide,
  .slide-item {
    display: flex;
    flex-direction: column;
    background: #ffffff;
  }
  .slide > img,
  .slide > picture > img,
  .slide-item > img,
  .slide-item > picture > img {
    height: 188px !important;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center right;
  }
  .slide .slide-card-overlay {
    position: relative !important;
    inset: auto !important;
    flex: 1 1 auto;
    display: flex !important;
    align-items: stretch !important;
    background: #ffffff;
  }
  .slide .slide-card-container {
    padding: 0 !important;
    display: flex;
    align-items: stretch;
    width: 100%;
  }
  .slide .slide-card-box {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 14px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff !important;
  }
  .slide .slide-card-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
  }
  .slider-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
    top: 94px !important;
    background: rgba(15, 23, 42, 0.5);
  }
  .slider-btn.prev { left: 8px; }
  .slider-btn.next { right: 8px; }
  .slider-dots {
    top: 164px !important;
    bottom: auto !important;
  }
}

.slider-dots .dot,
.slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dots .dot.active,
.slider-dots button.active,
.slider-dots button.w-8 {
  width: 26px !important;
  border-radius: 6px !important;
  background: var(--color-accent) !important;
  box-shadow: 0 0 8px rgba(251, 211, 11, 0.7);
}

.slider-dots .dot:hover,
.slider-dots button:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* --------------------------------------------------------------------------
   5. PARTNERS INFINITE MARQUEE TICKER (Auto-Scrolling)
   -------------------------------------------------------------------------- */
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   6. CARD HOVER & ZOOM EFFECTS (Product & Project Cards)
   -------------------------------------------------------------------------- */
.card-hover-zoom {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  will-change: transform, box-shadow;
}

.card-hover-zoom:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px -10px rgba(17, 77, 157, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(17, 77, 157, 0.3) !important;
}

.img-zoom {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.card-hover-zoom:hover .img-zoom {
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   7. SCROLL REVEAL ANIMATIONS (AOS Style Pure CSS/JS)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --------------------------------------------------------------------------
   8. STATS COUNTER PULSE & NUMBERS
   -------------------------------------------------------------------------- */
.counter-box {
  transition: transform 0.3s ease;
}
.counter-box:hover {
  transform: scale(1.05);
}
.counter-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* --------------------------------------------------------------------------
   9. FLOATING ACTION BUTTONS (Pulse Wave & Ring Animation)
   -------------------------------------------------------------------------- */
@keyframes ring-wave {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  65% {
    transform: scale(1.06);
    box-shadow: 0 0 0 18px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes zalo-wave {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
  }
  65% {
    transform: scale(1.06);
    box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@keyframes phone-shake {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-15deg); }
  20%, 40% { transform: rotate(15deg); }
  50% { transform: rotate(0deg); }
}

.btn-pulse,
.pulse-btn {
  animation: ring-wave 2.2s infinite ease-in-out;
}

a[href*="zalo"].btn-pulse {
  animation: zalo-wave 2.2s infinite ease-in-out;
}

.btn-pulse i,
.pulse-btn i {
  display: inline-block;
  animation: phone-shake 3s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   10. SEARCH MODAL & POPUP ANIMATION
   -------------------------------------------------------------------------- */
.modal-backdrop {
  backdrop-filter: blur(8px);
  background-color: rgba(15, 23, 42, 0.75);
  transition: opacity 0.3s ease;
}

@keyframes modal-scale-up {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-scale-up {
  animation: modal-scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.4s ease-out forwards;
}

/* --------------------------------------------------------------------------
   11. MOBILE DRAWER TRANSITIONS
   -------------------------------------------------------------------------- */
.mobile-drawer {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* --------------------------------------------------------------------------
   12. BACK TO TOP BUTTON
   -------------------------------------------------------------------------- */
#back-to-top {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 10px 20px -3px rgba(17, 77, 157, 0.4);
}

/* --------------------------------------------------------------------------
   13. LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
#image-lightbox {
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.88);
  transition: all 0.3s ease;
}

#lightbox-img {
  animation: modal-scale-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   14. TOAST NOTIFICATION
   -------------------------------------------------------------------------- */
#pqs-toast {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   15. BUTTON MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
button, a.inline-flex, a.bg-primary, a.bg-accent {
  position: relative;
  overflow: hidden;
}

.btn-glow:hover {
  box-shadow: 0 0 25px rgba(251, 211, 11, 0.6);
}

/* --------------------------------------------------------------------------
   16. STOREFRONT PAGINATION
   -------------------------------------------------------------------------- */
.client-pagination-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
  .client-pagination-nav {
    flex-direction: row;
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination .page-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.pagination .page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px -2px rgba(17, 77, 157, 0.35);
}

.pagination .page-item.disabled .page-link {
  background-color: #f1f5f9;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

/* Fallback if Bootstrap 5 pagination view is ever rendered directly on storefront */
nav.d-flex {
  width: 100%;
}
nav.d-flex > .d-sm-none {
  display: none !important;
}
nav.d-flex > .d-none.d-sm-flex {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

