/*
 * Taicera Theme — assets/css/main.css
 *
 * Main stylesheet (non-critical styles, loaded after critical.css inline).
 * Enqueued via wp_enqueue_scripts in functions.php.
 * Version is derived from filemtime() for cache busting.
 *
 * This file is the single external CSS loaded in production (Requirements 10.5).
 */

/* =========================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   Full token set — Requirements 10.4
   Note: A minimal subset is also inlined in critical.css to prevent FOUC.
   ========================================================= */
:root {
  /* --- Color Palette --- */
  --color-primary: #c8a96e; /* Gold — brand accent */
  --color-primary-dark: #a5834a; /* Darker gold for hover states */
  --color-secondary: #2c3e50; /* Deep navy — headings, nav */
  --color-text: #333333; /* Default body text */
  --color-text-muted: #666666; /* Secondary / meta text */
  --color-text-light: #999999; /* Tertiary / placeholder text */
  --color-bg: #ffffff; /* Page background */
  --color-bg-dark: #1a1a1a; /* Dark sections (hero, footer) */
  --color-bg-subtle: #f8f5f0; /* Off-white card backgrounds */
  --color-border: #e0e0e0; /* Subtle dividers */
  --color-border-dark: #c0c0c0; /* Form inputs, stronger borders */
  --color-error: #dc3545; /* Validation errors */
  --color-success: #28a745; /* Success states */

  /* --- Typography --- */
  --font-body:
    "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: var(--font-body);

  /* Font size scale (Requirements 10.4) */
  --text-xs: 0.75rem; /*  12px */
  --text-sm: 0.875rem; /*  14px */
  --text-base: 1rem; /*  16px */
  --text-md: 1.125rem; /*  18px */
  --text-lg: 1.25rem; /*  20px */
  --text-xl: 1.5rem; /*  24px */
  --text-2xl: 1.875rem; /*  30px */
  --text-3xl: 2.25rem; /*  36px */
  --text-4xl: 3rem; /*  48px */

  /* --- Spacing Scale (Requirements 10.4) --- */
  --space-1: 0.25rem; /*  4px  */
  --space-2: 0.5rem; /*  8px  */
  --space-3: 0.75rem; /*  12px */
  --space-4: 1rem; /*  16px */
  --space-5: 1.25rem; /*  20px */
  --space-6: 1.5rem; /*  24px */
  --space-8: 2rem; /*  32px */
  --space-10: 2.5rem; /*  40px */
  --space-12: 3rem; /*  48px */
  --space-16: 4rem; /*  64px */
  --space-20: 5rem; /*  80px */
  --space-24: 6rem; /*  96px */

  /* --- Shape & Shadow --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);

  /* --- Layout --- */
  --container-max: 1280px;

  /* --- Animation --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* =========================================================
   GLOBAL OVERFLOW GUARD
   Prevents horizontal scroll at any viewport width 320px–2560px.
   Requirement 10.3
   ========================================================= */
html,
body {
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0; /* Prevents flex/grid children from overflowing */
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   CONTAINER UTILITY
   Constrains content width and adds horizontal padding
   so nothing overflows at 320px.
   ========================================================= */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
  width: 100%;
}

/* =========================================================
   PRODUCT GRID — Responsive layout
   2 cols  ≤768px (mobile)
   3 cols  769px–1024px (tablet)
   4 cols  ≥1025px (desktop)
   Requirements: 2.2, 10.3
   ========================================================= */
.product-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(2, 1fr); /* Mobile default: 2 columns */
  width: 100%;
}

/* Tablet: 3 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: 4 columns */
@media (min-width: 1025px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================================
   PRODUCT CARD
   ========================================================= */
.product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-card__image-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg-subtle);
}

.product-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.product-card:hover .product-card__image-wrap img {
  transform: scale(1.04);
}

.product-card__body {
  padding: var(--space-4);
}

.product-card__category {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.product-card__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-secondary);
  line-height: 1.4;
}

/* =========================================================
   SITE HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
  gap: var(--space-6);
}

.site-branding .site-title-link {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-secondary);
  text-decoration: none;
}

/* =========================================================
   PRIMARY NAVIGATION
   ========================================================= */
.primary-menu {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.primary-menu a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-secondary);
  text-decoration: none;
  padding-block: var(--space-2);
  position: relative;
  transition: color var(--transition-fast);
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-secondary);
  transition: all var(--transition-fast);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .primary-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
  }

  .primary-menu.is-open {
    display: flex;
  }
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero {
  background: var(--color-bg-dark);
  color: #fff;
  padding-block: var(--space-20);
  text-align: center;
}

.hero__headline {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  line-height: 1.15;
}

.hero__tagline {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-8);
  max-width: 640px;
  margin-inline: auto;
}

.hero__cta {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-base);
}

.hero__cta:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  line-height: 1;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* =========================================================
   ARCHIVE / CATEGORY PAGE
   ========================================================= */
.archive-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.archive-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.archive-description {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  max-width: 800px;
}

.archive-product-count {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.no-products-notice {
  padding: var(--space-12) 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

/* =========================================================
   PAGINATION
   ========================================================= */
.nav-links {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-block: var(--space-10);
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */
.breadcrumb,
.rank-math-breadcrumb {
  margin-bottom: var(--space-6);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
  list-style: none;
  font-size: var(--text-sm);
}

.breadcrumb__item a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb__item a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumb__item--current {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumb__sep {
  color: var(--color-text-light);
}

/* =========================================================
   CONTACT FORM
   ========================================================= */
.contact-form-wrap {
  max-width: 640px;
}

.form-field {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.form-label .required {
  color: var(--color-error);
  margin-left: var(--space-1);
}

.form-label .optional {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin-left: var(--space-1);
}

.form-input,
.form-textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  line-height: 1.5;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2);
}

.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--color-error);
}

.form-field__error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-error);
  min-height: 1.2em;
}

.form-field__hint {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.form-actions {
  margin-top: var(--space-6);
}

.contact-form__success,
.contact-form__error-banner {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.contact-form__success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.contact-form__error-banner {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.8);
  padding-block: var(--space-16);
  margin-top: var(--space-20);
}

.footer-grid {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: 1fr;
}

@media (min-width: 769px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-heading {
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--space-4);
}

.footer-brand-name {
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
}

.footer-tagline {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.footer-menu {
  list-style: none;
}

.footer-menu li {
  margin-bottom: var(--space-2);
}

.footer-menu a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-menu a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-address {
  font-style: normal;
  font-size: var(--text-sm);
  line-height: 1.7;
}

.footer-bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.footer-copyright a {
  color: rgba(255, 255, 255, 0.7);
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* =========================================================
   404 PAGE
   ========================================================= */
.error-404 {
  padding-block: var(--space-20);
  text-align: center;
}

.error-404 .page-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-6);
}

.error-404 .page-content p {
  margin-bottom: var(--space-6);
  color: var(--color-text-muted);
}

.search-form-wrap {
  margin-top: var(--space-10);
  max-width: 480px;
  margin-inline: auto;
}

/* =========================================================
   UTILITY
   ========================================================= */
.site-main {
  padding-block: var(--space-10);
  min-height: 60vh;
}

/* Homepage sections manage their own padding; remove extra outer padding. */
.home .site-main {
  padding-block: 0;
}

/* =========================================================
   HOMEPAGE — SECTION HEADINGS
   ========================================================= */
.section-heading {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-secondary);
  text-align: center;
  margin-bottom: var(--space-3);
}

.section-subheading {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-md);
  margin-bottom: var(--space-10);
  max-width: 640px;
  margin-inline: auto;
}

/* =========================================================
   HOMEPAGE — FEATURED PRODUCTS SECTION
   Requirements: 1.3, 1.4
   ========================================================= */
.hp-featured-products {
  padding-block: var(--space-20);
  background: var(--color-bg);
}

.hp-featured-products__cta-wrap {
  text-align: center;
  margin-top: var(--space-10);
}

/* =========================================================
   HOMEPAGE — ABOUT BRAND SECTION
   Three labeled subsections: Lịch sử, Giá trị, Chất lượng
   Requirements: 1.5
   ========================================================= */
.hp-about-brand {
  padding-block: var(--space-20);
  background: var(--color-bg-subtle);
}

.hp-about-brand__grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr; /* Mobile: single column */
}

@media (min-width: 769px) {
  .hp-about-brand__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* About Brand Card */
.about-brand-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.about-brand-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.about-brand-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
  background: rgba(200, 169, 110, 0.12);
  border-radius: 50%;
  color: var(--color-primary);
}

.about-brand-card__icon svg {
  flex-shrink: 0;
}

.about-brand-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: var(--space-4);
}

.about-brand-card__content {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* =========================================================
   HOMEPAGE — CALL TO ACTION SECTION
   Requirements: 1.6, 1.7
   ========================================================= */
.hp-cta {
  padding-block: var(--space-20);
  background: var(--color-secondary);
  color: #fff;
}

.hp-cta__inner {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}

.hp-cta__heading {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-5);
}

.hp-cta__text {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.hp-cta__btn {
  font-size: var(--text-md);
  padding: var(--space-4) var(--space-10);
}

/* Adjust btn--primary on dark background */
.hp-cta .btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.hp-cta .btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* =========================================================
   PRODUCT DETAIL PAGE — Requirements 3.1–3.7
   ========================================================= */

/* Discontinued banner — Requirement 3.7 */
.product-detail__discontinued {
  background: #dc3545;
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-detail__discontinued-label {
  font-weight: 700;
  font-size: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Discontinued badge inline near product name */
.product-detail__badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: var(--space-3);
}

.product-detail__badge--discontinued {
  background: #dc3545;
  color: #fff;
}

/* Two-column layout: gallery left, meta right */
.product-detail__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

@media (min-width: 769px) {
  .product-detail__layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 1025px) {
  .product-detail__layout {
    grid-template-columns: 3fr 2fr;
  }
}

/* =========================================================
   PRODUCT GALLERY / CAROUSEL — Requirements 3.2
   ========================================================= */
.product-gallery {
  position: relative;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product-gallery__track {
  height: 100%;
}

.product-gallery__slide {
  display: none;
  height: 100%;
}

.product-gallery__slide--active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Navigation controls (prev/next) — only rendered when >1 image */
.product-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  cursor: pointer;
  transition: background var(--transition-fast);
  box-shadow: var(--shadow-sm);
  color: var(--color-secondary);
}

.product-gallery__nav:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.product-gallery__nav--prev {
  left: var(--space-3);
}

.product-gallery__nav--next {
  right: var(--space-3);
}

/* Dot indicators */
.product-gallery__dots {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 10;
}

.product-gallery__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast);
}

.product-gallery__dot--active,
.product-gallery__dot:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Counter */
.product-gallery__counter {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 10;
}

/* Thumbnail strip */
.product-gallery__thumbstrip {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.product-gallery__thumb {
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-bg-subtle);
  padding: 0;
  transition: border-color var(--transition-fast);
  flex-shrink: 0;
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-gallery__thumb--active,
.product-gallery__thumb:hover {
  border-color: var(--color-primary);
}

/* =========================================================
   PRODUCT META PANEL
   ========================================================= */
.product-detail__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.product-detail__header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.product-detail__name {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-secondary);
  line-height: 1.2;
  flex: 1 1 100%;
}

/* Specs table */
.product-detail__specs {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.product-detail__spec-row {
  border-bottom: 1px solid var(--color-border);
}

.product-detail__spec-row:last-child {
  border-bottom: none;
}

.product-detail__spec-label,
.product-detail__spec-value {
  padding: var(--space-3) var(--space-2);
  text-align: left;
  vertical-align: top;
}

.product-detail__spec-label {
  font-weight: 600;
  color: var(--color-text-muted);
  width: 40%;
  white-space: nowrap;
}

.product-detail__spec-value {
  color: var(--color-text);
}

/* Product description */
.product-detail__description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
}

/* CTA actions row */
.product-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.product-detail__contact-btn {
  flex: 1 1 auto;
  text-align: center;
}

.product-detail__spec-download {
  flex: 0 1 auto;
}

/* No image placeholder */
.product-detail__no-image {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail__placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.5;
}

/* =========================================================
   RELATED PRODUCTS SECTION — Requirement 3.3
   ========================================================= */
.related-products {
  margin-top: var(--space-16);
  padding-top: var(--space-10);
  border-top: 1px solid var(--color-border);
}

.related-products__heading {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: var(--space-8);
}

.related-products__grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 769px) {
  .related-products__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================================
   CONTACT PAGE — Requirements 4.1, 4.6, 4.7
   ========================================================= */

/* Two-column layout: form left, info + map right */
.contact-page__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  margin-top: var(--space-8);
}

@media (min-width: 769px) {
  .contact-page__layout {
    grid-template-columns: 3fr 2fr;
    align-items: start;
  }
}

.contact-page__header {
  margin-bottom: var(--space-6);
}

.contact-page__intro {
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: 1.7;
  max-width: 800px;
}

.contact-page__section-heading {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

/* Contact details block — Requirement 4.6 */
.contact-details {
  margin-bottom: var(--space-10);
}

.contact-details__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.contact-details__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: 1.6;
}

.contact-details__icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
  margin-top: 1px;
}

.contact-details__label {
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-right: var(--space-2);
}

.contact-details__phone-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.contact-details__phone-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.contact-details__address {
  font-style: normal;
  color: var(--color-text);
}

/* Business hours — Requirement 4.6
   Format: Thứ X–Thứ Y: HH:MM–HH:MM */
.contact-details__hours-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.contact-details__hours-item.business-hours {
  color: var(--color-text);
  font-size: var(--text-sm);
}

/* Google Maps embed — Requirement 4.7 */
.contact-page__map {
  margin-top: var(--space-8);
}

.contact-page__map-heading {
  margin-bottom: var(--space-4);
}

.contact-page__map-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  /* Maintain aspect ratio for the iframe on smaller screens */
  position: relative;
}

.contact-page__map-iframe {
  display: block;
  border: 0;
  width: 100%;
  min-height: 400px;
}

/* =========================================================
   PRODUCT FILTER BAR — Requirement 2.4
   ========================================================= */
.product-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
  padding: var(--space-5) var(--space-6);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}

.product-filter__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 160px;
  min-width: 140px;
}

.product-filter__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-filter__select {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  /* Native arrow — consistent cross-browser */
  appearance: auto;
}

.product-filter__select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2);
}

.product-filter__select:hover {
  border-color: var(--color-primary);
}

.product-filter__actions {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
}

/* Ensure [hidden] attribute always wins — some resets/plugins override it */
[hidden] {
  display: none !important;
}

/* Loading overlay for the product grid */
.product-grid-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) 0;
}

.product-grid-loading__spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: taicera-spin 0.7s linear infinite;
}

@keyframes taicera-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile: stack filters vertically */
@media (max-width: 768px) {
  .product-filter {
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .product-filter__field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .product-filter__actions {
    width: 100%;
  }

  .product-filter__reset {
    width: 100%;
    justify-content: center;
  }
}
