/* ==========================================================================
   Thiên Ngải Sơn - Tận tâm vì sức khỏe – Bền vững vì tương lai
   Theme Colors (from Logo):
     - Primary: #3E7B27 (Xanh lá thảo dược tươi sáng - Màu chủ đạo)
     - Primary Dark: #2F5E1E
     - Primary Light: #589E39
     - Primary 50: #F1F7EE
     - Accent Gold: #C59226 (Vàng hoàng kim sang trọng - Màu phụ/nhấn)
     - Accent Purple: #6B2352 (Tím ngải đen - Badge deal/khuyến mãi)
     - Dark: #1C1510 (Nâu đen trầm)
     - Cream/Surface: #F7FAF5 (Nền xanh kem sáng tự nhiên)
   Typography:
     - Headings: 'Phudu', display (SemiBold 600) cho tiêu đề các section
     - Body & UI: 'Gilroy' (SVN-Gilroy từ assets/fonts) cho tên sản phẩm & nội dung
   Style: Clean, flat, elegant, no excessive gradients.
   ========================================================================== */

/* -------------------------------------------------------------
 * 1. FONT DEFINITIONS (GILROY)
 * ------------------------------------------------------------- */
@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../fonts/SVN-Gilroy Black.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------
 * 2. ROOT VARIABLES & GLOBAL RESETS
 * ------------------------------------------------------------- */
:root {
  /* Brand Color Palette - Fresh Organic Leaf Green as Primary */
  --color-primary: #3E7B27;
  --color-primary-dark: #2F5E1E;
  --color-primary-light: #589E39;
  --color-primary-50: #F1F7EE;

  --color-gold: #C59226;
  --color-gold-dark: #9E7117;
  --color-gold-50: #FAF4E8;

  --color-accent: #6B2352;
  --color-accent-light: #8A346C;
  --color-accent-50: #F9EFF5;

  --color-dark: #1C1510;
  --color-dark-muted: #4A3E37;
  --color-cream: #F7FAF5;
  --color-cream-dark: #EDF3EB;
  --color-border: #E0EADE;

  /* Fonts */
  --font-heading: 'Phudu', sans-serif;
  --font-body: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  color: var(--color-dark);
  background-color: #ffffff;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
}

/* Section titles use Phudu SemiBold 600 only */
h1, h2, .section-title, .hero-title, .font-heading {
  font-family: var(--font-heading);
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

/* Product titles & general cards use Gilroy SemiBold 600 only */
h3, h4, h5, h6, .product-title, .product-name {
  font-family: var(--font-body);
  font-weight: 600 !important;
}

/* Explicit rule: all headings strictly semibold */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600 !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #EDF3EB;
}
::-webkit-scrollbar-thumb {
  background: #3E7B27;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2F5E1E;
}

/* Smooth transitions */
.transition-smooth {
  transition: all 0.25s ease-in-out;
}

/* Image zoom on hover */
.img-zoom-container {
  overflow: hidden;
}
.img-zoom-container img {
  transition: transform 0.4s ease;
}
.group:hover .img-zoom-container img,
.img-zoom-container:hover img {
  transform: scale(1.06);
}

/* Clean Flat Badges - Minimum 14px (text-sm) */
.badge-sale {
  background-color: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

.badge-organic {
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

/* Slider state */
.slide-item {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.slide-item.active {
  display: block;
  opacity: 1;
}

/* Card hover */
.card-hover-effect {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-hover-effect:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(28, 21, 16, 0.08);
  border-color: rgba(62, 123, 39, 0.45);
}

/* Sticky Header styling */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.header-sticky.is-scrolled {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(28, 21, 16, 0.06);
}

/* Solid Clean Buttons (Fresh Green as Primary) */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  transition: all 0.25s ease;
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--color-gold);
  color: #ffffff;
  font-weight: 600;
  transition: all 0.25s ease;
}
.btn-secondary:hover {
  background-color: var(--color-gold-dark);
  color: #ffffff;
}

/* Progress bar inside deals */
.deal-progress-bar {
  background: #E0EADE;
  border-radius: 999px;
  overflow: hidden;
  height: 6px;
}
.deal-progress-bar-fill {
  background-color: var(--color-primary);
  height: 100%;
  border-radius: 999px;
}

/* S-Curve Wave Background for Category Menu (Uốn lượn mềm mại phong cách hình mẫu) */
.category-wave-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.category-wave-btn {
  position: relative;
  background-color: var(--color-primary-dark);
  color: #ffffff;
  padding: 0.875rem 1.25rem 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.25s ease;
  z-index: 10;
}
.category-wave-btn:hover {
  background-color: #244916;
}
.category-wave-tail {
  position: absolute;
  right: -27px;
  top: 0;
  bottom: 0;
  width: 28px;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
.category-wave-tail svg {
  width: 100%;
  height: 100%;
  fill: var(--color-primary-dark);
  transition: fill 0.25s ease;
}
.group:hover .category-wave-tail svg {
  fill: #244916;
}

/* -------------------------------------------------------------
 * 7. HERO BANNER SLIDER
 * ------------------------------------------------------------- */
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

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

.hero-slide .slide-content {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, opacity 0.5s ease 0.1s;
}

.hero-slide.active .slide-content {
  transform: translateY(0);
  opacity: 1;
}

/* -------------------------------------------------------------
 * 8. DEAL SECTION MINI PRODUCT CARDS
 * ------------------------------------------------------------- */
.deal-product-card {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0.85rem 1.125rem;
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.deal-product-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 6px 16px rgba(62, 123, 39, 0.1);
  transform: translateY(-2px);
}

.deal-product-card .card-thumb {
  width: 5.75rem;
  height: 5.75rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background-color: #f8faf7;
  padding: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deal-product-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.deal-product-card:hover .card-thumb img {
  transform: scale(1.08);
}

.deal-product-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
  min-width: 0;
  padding-left: 1.125rem;
}

/* -------------------------------------------------------------
 * 9. CART BADGE (ROUND, CRISP, PERFECTLY CENTERED)
 * ------------------------------------------------------------- */
.cart-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 9999px;
  background-color: var(--color-purple, #6B21A8);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 20;
}

/* -------------------------------------------------------------
 * 10. NAV MENU ITEMS & ACTIVE BORDER-BOTTOM
 * ------------------------------------------------------------- */
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 0.25rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  line-height: 1.25rem;
  cursor: pointer;
}

.nav-item:hover {
  color: #ffffff;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #ffffff;
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover::after {
  transform: scaleX(1);
}

.nav-item.active {
  color: #ffffff;
  font-weight: 700;
}

.nav-item.active::after {
  transform: scaleX(1);
}

/* -------------------------------------------------------------
 * 11. ENFORCE MINIMUM FONT SIZE >= 14PX (TEXT-SM)
 * ------------------------------------------------------------- */
.text-xs,
[class*="text-[9px]"],
[class*="text-[9.5px]"],
[class*="text-[10px]"],
[class*="text-[10.5px]"],
[class*="text-[11px]"],
[class*="text-[12px]"],
[class*="text-[13px]"] {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}
