/**
 * Cơ Điện & PCCC Anh Quân - Custom Theme Stylesheet (theme-custom.css)
 * Phiên bản: V1.0 - Block Theme FSE
 * Bổ sung: Hiệu ứng chuông rung Hotline, Sóng tỏa, Ruy-băng cờ đuôi nheo, Popup Modal báo giá, Floating Widgets
 */

:root {
  --aq-primary: #0B3B60;
  --aq-primary-dark: #07263E;
  --aq-primary-light: #12588F;
  --aq-secondary: #D32F2F;
  --aq-secondary-dark: #B71C1C;
  --aq-accent: #0284C7;
  --aq-accent-light: #38BDF8;
  --aq-slate-900: #0F172A;
  --aq-slate-700: #334155;
  --aq-slate-500: #64748B;
  --aq-slate-200: #E2E8F0;
  --aq-slate-50: #F8FAFC;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--wp--preset--font-family--be-vietnam-pro, 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--aq-slate-700);
  background-color: #ffffff;
}

/* ==========================================================================
   1. Animation Rung chuông & Sóng tỏa (Hotline & Floating Widgets)
   ========================================================================== */

/* Hiệu ứng rung lắc chuông điện thoại */
@keyframes bell-shake {
  0%, 100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(14deg);
  }
  30% {
    transform: rotate(-14deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(4deg);
  }
}

.animate-bell-shake {
  display: inline-block;
  animation: bell-shake 1.8s infinite ease-in-out;
  transform-origin: center center;
}

/* Sóng lan tỏa của nút Hotline nổi (Đỏ PCCC) */
@keyframes pulse-ring-red {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.pulse-ring-red {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: rgba(211, 47, 47, 0.45);
  animation: pulse-ring-red 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: 0;
}

/* Sóng lan tỏa của nút Zalo nổi (Xanh Dương Điểm Nhấn) */
@keyframes pulse-ring-blue {
  0% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.pulse-ring-blue {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: rgba(2, 132, 199, 0.45);
  animation: pulse-ring-blue 2s cubic-bezier(0.24, 0, 0.38, 1) infinite 0.4s;
  z-index: 0;
}

/* ==========================================================================
   2. Hero Banner: Vết cắt nghiêng đa giác đáy (Slanted Angle Divider)
   ========================================================================== */
.hero-slanted-bg {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%);
}

@media (max-width: 768px) {
  .hero-slanted-bg {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), 0 100%);
  }
}

/* Vòng xoay chậm cho HUD Tech Circle trang trí */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 35s linear infinite;
}

/* ==========================================================================
   3. Khối Về Chúng Tôi: Khung hình 3D Offset Layered Frame
   ========================================================================== */
.about-team-frame {
  position: relative;
}

.about-team-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: -14px;
  bottom: -14px;
  background-color: var(--aq-primary);
  border-radius: 1.5rem;
  z-index: 1;
}

/* ==========================================================================
   4. Khối Sản Phẩm: Ruy-băng "Bán chạy" đuôi nheo & Card hover
   ========================================================================== */
.ribbon-swallowtail {
  clip-path: polygon(0 0, 100% 0, 84% 50%, 100% 100%, 0 100%);
}

.product-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(11, 59, 96, 0.12), 0 4px 6px -2px rgba(11, 59, 96, 0.05);
}

/* ==========================================================================
   5. Hiệu ứng Modal Popup Báo giá
   ========================================================================== */
.modal-backdrop {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background-color: rgba(7, 38, 62, 0.75);
}

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

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

/* ==========================================================================
   6. Họa tiết Blueprint Grid kỹ thuật chuẩn ngành Cơ Điện & PCCC
   ========================================================================== */
.blueprint-grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ==========================================================================
   7. Tùy biến thanh cuộn hiện đại
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--aq-slate-50);
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--aq-primary);
}

/* Ẩn thanh cuộn cho Tabs vuốt ngang trên Mobile (No-scrollbar) */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   8. Thẻ dự án & Card chuyển động mượt mà
   ========================================================================== */
.project-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover {
  transform: translateY(-6px);
}

/* ==========================================================================
   9. Mobile Bottom Action Bar
   ========================================================================== */
.mobile-bottom-bar {
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

@media (min-width: 1024px) {
  .mobile-bottom-bar {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  body {
    padding-bottom: 60px;
  }
  .mobile-bottom-bar {
    display: block !important;
  }
  .anhquan-floating-actions {
    bottom: 80px !important;
  }
}

/* ==========================================================================
   10. Thông báo trạng thái Form (Alert Box)
   ========================================================================== */
.form-status-message {
  transition: all 0.3s ease;
}

.form-status-message.is-success {
  display: block !important;
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.form-status-message.is-error {
  display: block !important;
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ==========================================================================
   11. Header & Navigation Refinements
   ========================================================================== */
.anhquan-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

@media (max-width: 768px) {
  .anhquan-topbar-desktop-only {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .anhquan-header-cta {
    display: none !important;
  }
}

/* ==========================================================================
   12. Floating Widget Container
   ========================================================================== */
.anhquan-floating-actions {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   13. Tabs & State Utilities
   ========================================================================== */
[data-category-tab] {
  background-color: #ffffff;
  color: #1e293b;
  transition: all 0.2s ease;
}

[data-category-tab].is-active {
  background-color: var(--aq-primary-dark) !important;
  color: #ffffff !important;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.15) !important;
}

.is-hidden,
.hidden {
  display: none !important;
}

#product-quote-modal.flex {
  display: flex !important;
}

body.overflow-hidden {
  overflow: hidden !important;
}
