/* ==========================================================================
   CÔNG TY CỔ PHẦN SVC THÁI AN - SINH VẬT CẢNH THÁI AN
   Tailwind Companion Stylesheet
   ========================================================================== */

/* --- Font Import (SVN-Gilroy Việt Hóa) --- */
@import url('fonts.css');

/* --- Base Typography & Reset --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'SVN-Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   RESPONSIVE TYPOGRAPHY & CRISPNESS OPTIMIZATION (MÀN HÌNH LỚN)
   Khắc phục hiện tượng chữ mờ, nét mảnh và font size nhỏ trên màn hình lớn
   ========================================================================== */

/* ==========================================================================
   QUY CHUẨN KÍCH THƯỚC CHỮ: KHÔNG DƯỚI XS, TẤT CẢ PHẢI TỪ SM TRỞ LÊN
   ========================================================================== */

/* Thiết lập sàn font size tối thiểu cho toàn bộ website (Áp dụng từ mobile) */
.text-xs,
[class*="text-xs"],
[class*="text-[10px]"],
[class*="text-[11px]"],
[class*="text-[12px]"],
[class*="text-[13px]"] {
  font-size: 0.875rem !important; /* Tối thiểu chuẩn 14px (sm), không để chữ li ti */
  line-height: 1.45 !important;
}

.text-sm,
[class*="text-sm"] {
  font-size: 0.9375rem !important; /* ~15px */
  line-height: 1.5 !important;
}

/* ==========================================================================
   TIÊU ĐỀ CARD TO RÕ RÀNG TRÊN MỌI THIẾT BỊ (PRODUCT, NEWS, SERVICE, VALUES)
   ========================================================================== */
.card h2, .card h3, .card h4,
.product-card h2, .product-card h3, .product-card h4,
.catalog-product-item h2, .catalog-product-item h3, .catalog-product-item h4,
article h2, article h3, article h4,
.group h3.font-mulish, .group h4.font-mulish, .group h3.font-phudu, .group h4.font-phudu,
.group h3.font-gilroy, .group h4.font-gilroy,
[class*="product"] h3, [class*="product"] h2,
[class*="catalog"] h3, [class*="catalog"] h2 {
  font-size: 1.0625rem !important; /* ~17px trên mobile, to rõ và nổi bật */
  line-height: 1.4 !important;
}

@media (min-width: 640px) {
  .card h2, .card h3, .card h4,
  .product-card h2, .product-card h3, .product-card h4,
  .catalog-product-item h2, .catalog-product-item h3, .catalog-product-item h4,
  article h2, article h3, article h4,
  .group h3.font-mulish, .group h4.font-mulish, .group h3.font-phudu, .group h4.font-phudu,
  .group h3.font-gilroy, .group h4.font-gilroy,
  [class*="product"] h3, [class*="product"] h2,
  [class*="catalog"] h3, [class*="catalog"] h2 {
    font-size: 1.1875rem !important; /* ~19px - 20px */
    line-height: 1.35 !important;
  }
}

/* ==========================================================================
   TÊN SẢN PHẨM SỬ DỤNG FONT SVN-GILROY (SEMIBOLD, KHÔNG VIẾT HOA TOÀN BỘ)
   ========================================================================== */
.product-card h3,
.catalog-product-item h3,
.product-title,
.product-name,
#productDetailTitle,
h1.product-title,
.product-hero-title,
[class*="product"] h1,
[class*="product"] h3,
[class*="product"] h3 a,
[data-cat] h3,
[data-cat] h3 a,
[data-category] h3,
[data-category] h3 a {
  font-family: 'SVN-Gilroy', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: 600 !important; /* SemiBold theo yêu cầu */
  text-transform: none !important; /* Không viết full hoa */
  letter-spacing: -0.01em;
}

/* Laptop & Màn hình từ 1024px trở lên */
@media (min-width: 1024px) {
  html {
    font-size: 16.5px;
    -webkit-font-smoothing: subpixel-antialiased !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: optimizeLegibility;
  }

  body,
  body.antialiased,
  .antialiased {
    font-weight: 500;
    color: #1e293b;
    -webkit-font-smoothing: subpixel-antialiased !important;
    -moz-osx-font-smoothing: auto !important;
  }

  /* Nâng độ đậm của các đoạn văn bản chính để chữ đậm nét, rõ ràng, không bị mờ */
  p, li, dd, dt, td, th, input, textarea, select, button {
    font-weight: 500;
    letter-spacing: -0.005em;
  }

  /* Tăng độ đậm tương ứng cho các class để phân cấp rõ nét */
  .font-normal {
    font-weight: 500 !important;
  }

  .font-medium {
    font-weight: 600 !important;
  }

  b, strong, .font-semibold {
    font-weight: 600 !important;
  }

  .font-bold {
    font-weight: 700 !important;
  }

  /* Khắc phục màu chữ xám nhạt bị mờ trên nền sáng: tăng độ tương phản rõ ràng */
  .text-slate-400 {
    color: #64748b !important;
  }

  .text-slate-500 {
    color: #475569 !important;
  }

  .text-slate-600 {
    color: #334155 !important;
  }

  .text-slate-700 {
    color: #1e293b !important;
  }

  .text-slate-800 {
    color: #0f172a !important;
  }

  /* Chữ nhỏ nhất trên desktop luôn từ ~15.5px (tương đương sm) trở lên */
  .text-xs,
  [class*="text-xs"],
  [class*="text-[10px]"],
  [class*="text-[11px]"],
  [class*="text-[12px]"],
  [class*="text-[13px]"] {
    font-size: 0.9375rem !important; /* ~15.5px */
    line-height: 1.45rem !important;
  }

  .text-sm,
  [class*="text-sm"] {
    font-size: 1rem !important; /* 16.5px */
    line-height: 1.55rem !important;
  }

  /* Tiêu đề card to nổi bật trên desktop */
  .card h2, .card h3, .card h4,
  .product-card h2, .product-card h3, .product-card h4,
  .catalog-product-item h2, .catalog-product-item h3, .catalog-product-item h4,
  article h2, article h3, article h4,
  .group h3.font-mulish, .group h4.font-mulish, .group h3.font-phudu, .group h4.font-phudu,
  [class*="product"] h3, [class*="product"] h2,
  [class*="catalog"] h3, [class*="catalog"] h2 {
    font-size: 1.25rem !important; /* ~20.6px */
    line-height: 1.35 !important;
  }
}

/* Desktop chuẩn (Màn hình từ 1280px trở lên) */
@media (min-width: 1280px) {
  html {
    font-size: 17px; /* 1rem = 17px, tự động nâng font size toàn bộ website */
  }

  .text-xs,
  [class*="text-xs"],
  [class*="text-[10px]"],
  [class*="text-[11px]"],
  [class*="text-[12px]"],
  [class*="text-[13px]"] {
    font-size: 0.95rem !important; /* ~16.1px */
  }

  .text-sm,
  [class*="text-sm"] {
    font-size: 1.025rem !important; /* ~17.4px */
  }

  .card h2, .card h3, .card h4,
  .product-card h2, .product-card h3, .product-card h4,
  .catalog-product-item h2, .catalog-product-item h3, .catalog-product-item h4,
  article h2, article h3, article h4,
  .group h3.font-mulish, .group h4.font-mulish, .group h3.font-phudu, .group h4.font-phudu,
  [class*="product"] h3, [class*="product"] h2,
  [class*="catalog"] h3, [class*="catalog"] h2 {
    font-size: 1.3125rem !important; /* ~22.3px */
  }
}

/* Màn hình lớn Full HD / 2K / 24"-27" (Màn hình từ 1536px trở lên) */
@media (min-width: 1536px) {
  html {
    font-size: 17.5px; /* 1rem = 17.5px */
  }

  .text-xs,
  [class*="text-xs"],
  [class*="text-[10px]"],
  [class*="text-[11px]"],
  [class*="text-[12px]"],
  [class*="text-[13px]"] {
    font-size: 0.95rem !important; /* ~16.6px */
  }

  .text-sm,
  [class*="text-sm"] {
    font-size: 1.05rem !important; /* ~18.3px */
  }

  .card h2, .card h3, .card h4,
  .product-card h2, .product-card h3, .product-card h4,
  .catalog-product-item h2, .catalog-product-item h3, .catalog-product-item h4,
  article h2, article h3, article h4,
  .group h3.font-mulish, .group h4.font-mulish, .group h3.font-phudu, .group h4.font-phudu,
  [class*="product"] h3, [class*="product"] h2,
  [class*="catalog"] h3, [class*="catalog"] h2 {
    font-size: 1.375rem !important; /* ~24px */
  }
}

/* --- Hero Slider Active States --- */
.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

/* --- Cart Drawer States --- */
#cartDrawer.open {
  transform: translateX(0);
}

#cartDrawerOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- Auth Modal States --- */
#authModalOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

#authModalOverlay.open > div {
  transform: scale(1);
}

/* --- Toast Notification State --- */
#toastNotification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* --- Mobile Sidebar States --- */
#mobileSidebar.open {
  transform: translateX(0);
}

#mobileSidebarOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- GTranslate Widget Styling --- */
.gtranslate_wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.gtranslate_wrapper a {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
  line-height: 1;
}

.gtranslate_wrapper a:hover {
  transform: scale(1.08);
  opacity: 0.9;
}

.gtranslate_wrapper img {
  display: block;
  border-radius: 2px;
}

/* Typography: All bold elements use semibold (weight 600) */
b, strong {
  font-weight: 600;
}

/* Floating Contact Button Animations */
@keyframes phone-ring {
  0% { transform: rotate(0) scale(1) skew(1deg); }
  10% { transform: rotate(-25deg) scale(1) skew(1deg); }
  20% { transform: rotate(25deg) scale(1) skew(1deg); }
  30% { transform: rotate(-25deg) scale(1) skew(1deg); }
  40% { transform: rotate(25deg) scale(1) skew(1deg); }
  50% { transform: rotate(0) scale(1) skew(1deg); }
  100% { transform: rotate(0) scale(1) skew(1deg); }
}

.animate-phone {
  animation: phone-ring 1.8s infinite ease-in-out;
}


/* ==========================================================================
   MULISH FONT WEIGHT OPTIMIZATION (ĐẬM RÕ NÉT - WEIGHT 700 & 800)
   ========================================================================== */
.font-mulish {
  font-weight: 700 !important;
}
.font-mulish.font-extrabold,
.font-mulish.font-black,
h1.font-mulish,
h2.font-mulish {
  font-weight: 800 !important;
}

/* ==========================================================================
   FOOTER TYPOGRAPHY & LAYOUT OPTIMIZATION (KHẮC PHỤC RỚT CHỮ)
   ========================================================================== */
footer h3 {
  letter-spacing: -0.01em !important;
  word-break: keep-all !important;
}

footer .footer-brand-title {
  white-space: nowrap !important;
  letter-spacing: -0.01em !important;
}

footer .footer-slogan {
  white-space: nowrap !important;
}

@media (min-width: 1024px) {
  footer .footer-grid {
    grid-template-columns: 1.35fr 1.15fr 0.75fr 1fr !important;
  }
}
