/**
 * Design system Thịnh Phát — đồng bộ trang chủ, catalog, chi tiết mẫu.
 */
:root {
  --ui-radius-sm: 6px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 12px;
  --ui-shadow-card: 0 2px 12px rgba(21, 58, 122, 0.08);
  --ui-shadow-hover: 0 14px 28px rgba(21, 58, 122, 0.14);
  --ui-border: #e2e8f0;
  --ui-border-soft: #ebe6de;
  --ui-surface: #ffffff;
  --ui-surface-muted: var(--bg-soft);
  --ui-thumb-bg: linear-gradient(180deg, #faf7f0 0%, #f3ebe0 55%, #efe6d8 100%);
}

/* ——— Trang catalog ——— */
body.page-catalog {
  background: var(--bg-page);
}

body.page-catalog main {
  min-height: 40vh;
}

.page-loading {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

.page-loading::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 3px solid var(--brand-light);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: uiSpin 0.7s linear infinite;
}

@keyframes uiSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Tiêu đề trang — cùng ngôn ngữ với .section-title */
.page-hero-title {
  background: linear-gradient(180deg, var(--white) 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid var(--ui-border);
}

.page-hero-title .container {
  padding: 20px 16px 22px;
}

.page-hero-title h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-darker);
}

.page-hero-title h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent-red));
}

.ui-heading {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-darker);
}

.ui-heading::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--accent-red);
}

.ui-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  box-shadow: var(--ui-shadow-card);
}

/* Breadcrumb đồng bộ brand */
.breadcrumb-nav {
  background: var(--brand-darker);
  border-bottom: none;
  font-size: 13px;
}

.breadcrumb-nav .container {
  padding: 11px 16px;
}

.breadcrumb-nav ol {
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb-nav li + li::before {
  color: rgba(255, 255, 255, 0.45);
}

.breadcrumb-nav a {
  color: var(--white);
  font-weight: 500;
}

.breadcrumb-nav a:hover {
  color: var(--cmyk-c);
}

.breadcrumb-nav li[aria-current="page"] {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

/* Banner sản phẩm */
.product-hero-banner {
  background: var(--ui-surface-muted);
}

.product-hero-banner--placeholder {
  min-height: 200px;
  background: var(--ui-thumb-bg);
}

/* Thẻ mẫu — đồng bộ product-card trang chủ */
.sample-card--unified {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border-soft);
  border-radius: var(--ui-radius-sm);
  box-shadow: var(--ui-shadow-card);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.sample-card--unified:hover {
  transform: translateY(-4px);
  box-shadow: var(--ui-shadow-hover);
  border-color: var(--brand);
}

.sample-card--unified .sample-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.sample-card--unified .sample-card__thumb {
  position: relative;
  aspect-ratio: 353 / 319;
  background: var(--ui-thumb-bg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sample-card--unified .sample-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.sample-card--unified:hover .sample-card__thumb img {
  transform: scale(1.03);
}

.sample-card--unified .sample-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 58, 122, 0.55);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.25s;
}

.sample-card--unified:hover .sample-card__overlay {
  opacity: 1;
}

.sample-card--unified .sample-card__body {
  padding: 12px 10px 14px;
  text-align: center;
  border-top: 1px solid var(--ui-border-soft);
}

.sample-card--unified .sample-card__body h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-darker);
}

.sample-card--unified .sample-card__body p {
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* Sidebar & info — dùng ui-card */
.sidebar-box,
.product-info-card,
.sample-empty {
  border-radius: var(--ui-radius-md);
  border-color: var(--ui-border);
  box-shadow: var(--ui-shadow-card);
}

.product-info-card h2,
.sample-article__title,
.sample-related h2 {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-darker);
}

.product-info-card h2::after,
.sample-related h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  background: var(--accent-red);
  border-radius: 2px;
}

.sample-article__title {
  border-bottom: none;
  padding-bottom: 0;
  display: block;
}

.sample-article__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 8px;
  background: var(--accent-red);
}

/* CTA thống nhất */
.sidebar-cta,
.sample-cta,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  padding: 12px 18px;
  border-radius: var(--ui-radius-sm);
  border: none;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.sidebar-cta:hover,
.sample-cta:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-red), var(--brand));
  color: var(--white);
}

.sidebar-cta--alt,
.sample-cta--outline,
.btn-outline {
  background: var(--white);
  color: var(--brand-dark);
  border: 2px solid var(--brand-light);
}

.sidebar-cta--alt:hover,
.sample-cta--outline:hover,
.btn-outline:hover {
  background: var(--brand-light);
  color: var(--brand-darker);
}

/* Thẻ liên quan */
.related-card {
  border-color: var(--ui-border-soft);
  border-radius: var(--ui-radius-sm);
  box-shadow: var(--ui-shadow-card);
}

.related-card img {
  background: var(--ui-thumb-bg);
}

/* Consult card ≈ staff card */
.consult-card__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: var(--ui-radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white) !important;
  font-size: 13px;
}

.consult-card__phone:hover {
  background: linear-gradient(135deg, var(--accent-red), var(--brand));
}

.product-sidebar,
.sample-sidebar {
  top: calc(var(--safe-top, 0px) + 88px);
}

.trust-badge--compact {
  display: flex;
}

@media (max-width: 992px) {
  .trust-badge--compact {
    display: none;
  }
}

@media (max-width: 768px) {
  .page-hero-title .container {
    padding: 16px;
  }

  .sample-card--unified .sample-card__body h3 {
    font-size: 12px;
  }
}
