/**
 * TCK Shop storefront — served as /static/store/css/store.css (Nginx).
 */
:root {
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e5e5e5;
  --accent: #0d6efd;
  --card-radius: 12px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  --mega-teal: #5bb69e;
  --mega-teal-hover: #4a9d86;
  --mega-parent-hover-bg: #e8e8e8;
  --mega-subtext: #6b6b6b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: var(--fg);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

/* Thanh điều hướng: rule navbar + mega menu nằm cuối file (trước đây navbar-bootstrap.css riêng) */
.site-header {
  z-index: 1030;
}

main,
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-main--landing {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Toast alerts — góc phải trên, tự đóng (site.js) */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  left: auto;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-stack {
    top: 0.65rem;
    right: 0.65rem;
    left: 0.65rem;
    max-width: none;
    align-items: stretch;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.65rem 0.85rem 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
  line-height: 1.45;
  color: #0f172a;
  animation: toast-slide-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.38s ease, opacity 0.38s ease;
}

.toast--exiting {
  transform: translateX(110%);
  opacity: 0;
}

@media (max-width: 480px) {
  .toast--exiting {
    transform: translateY(-120%);
  }
}

@keyframes toast-slide-in {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  @keyframes toast-slide-in {
    from {
      transform: translateY(-120%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

.toast__body {
  flex: 1;
  min-width: 0;
  padding-top: 0.1rem;
}

.toast__close {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.25rem -0.15rem -0.25rem 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.toast__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

.toast--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.toast--success .toast__body {
  color: #14532d;
}

.toast--error {
  background: #fef2f2;
  border-color: #fecaca;
}

.toast--error .toast__body {
  color: #991b1b;
}

.toast--warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.toast--warning .toast__body {
  color: #92400e;
}

.toast--info,
.toast--debug {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.toast--info .toast__body,
.toast--debug .toast__body {
  color: #1e3a8a;
}

.site-footer-minimal {
  background: #111;
  color: #ccc;
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.site-footer-minimal-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer-copy {
  margin: 0;
  font-size: 0.875rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Frontend image protection (deterrent only). */
.protected-image-wrap {
  position: relative;
  overflow: hidden;
}

.protected-image-shield {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: transparent;
  cursor: default;
  -webkit-touch-callout: none;
  user-select: none;
}

img[data-protected-image] {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}

/* Legacy .messages — dùng toast trong base.html */
.messages {
  list-style: none;
  padding: 0;
}

.messages li {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #e7f5ff;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

/*
 * Trang chủ (không sidebar): template dùng .landing-products-layout--full KHÔNG kèm .layout
 * để tránh grid 240px|1fr. (Nếu lỡ cả hai class: vẫn ép 1 cột.)
 */
.landing-products-layout--full {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.layout.landing-products-layout--full {
  grid-template-columns: 1fr !important;
  max-width: 100%;
}

.landing-products-main--full {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar ul ul {
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.sidebar a {
  text-decoration: none;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.sidebar a.is-selected {
  font-weight: 600;
  color: var(--accent);
}

form p {
  margin: 0.5rem 0;
}

input,
textarea,
select,
button {
  width: 100%;
  max-width: 32rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  max-width: 12rem;
  margin-top: 0.5rem;
}

.hero {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: var(--card-radius);
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 800px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.thumb {
  max-width: 100%;
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Product grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card-media {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
}

.product-card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  border: 1px solid var(--border);
}

.product-card-media-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-media-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #cbd5e1;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.product-card-body {
  padding: 1rem 1.1rem 1.15rem;
}

.product-card-body .product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.product-card-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.product-card-body h3 a {
  text-decoration: none;
  color: var(--fg);
}

.product-card-body h3 a:hover {
  color: var(--accent);
}

.product-card-body > p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #444;
}

.product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.price-text {
  font-size: 1rem;
  color: var(--fg);
}

.price-contact {
  font-size: 0.95rem;
  color: var(--accent);
}

.text-link {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Cụm FAB góc phải dưới viewport (fixed — không theo luồng sau footer) */
.site-fab-stack {
  position: fixed !important;
  left: auto !important;
  top: auto !important;
  right: 1rem;
  bottom: 1rem;
  z-index: 1038;
  display: flex !important;
  flex-direction: column;
  align-items: flex-end !important;
  justify-content: flex-end;
  gap: 0.75rem;
  width: max-content !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
}

.site-fab-stack > * {
  pointer-events: auto;
  flex: 0 0 auto !important;
  align-self: flex-end !important;
  max-width: 3rem !important;
}

@supports (right: max(0px, 1px)) {
  .site-fab-stack {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

.site-fab-stack .site-scroll-fab {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
}

/* Nút lên đầu — luôn hiện (không phụ thuộc JS / iOS scroll event); z-index cao */
.site-scroll-fab {
  position: fixed !important;
  left: auto !important;
  top: auto !important;
  right: 1rem;
  bottom: 1rem;
  z-index: 1038;
  width: 3rem;
  height: 3rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: var(--accent, #0d6efd);
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.site-scroll-fab:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
}

.site-scroll-fab:active {
  transform: translateZ(0) scale(0.96);
}

.site-scroll-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.site-scroll-fab__icon {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

@supports (right: max(0px, 1px)) {
  .site-scroll-fab {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Tab dọc bám cạnh phải — “Danh mục” (block edge_tabs) */
.site-edge-stack {
  position: fixed;
  right: 0;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  z-index: 1036;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  pointer-events: none;
}

.site-edge-stack > * {
  pointer-events: auto;
}

@supports (padding: max(0px)) {
  .site-edge-stack {
    right: env(safe-area-inset-right, 0px);
  }
}

.site-edge-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  min-height: 5.25rem;
  padding: 0.65rem 0.4rem;
  margin: 0;
  border: 1px solid #1a1a1a;
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: #fff;
  color: #1a1a1a;
  box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.site-edge-tab:hover {
  background: #f7f7f7;
}

.site-edge-tab:focus-visible {
  outline: 2px solid var(--accent, #0d6efd);
  outline-offset: 2px;
}

.site-edge-tab__label {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
}

@media (max-width: 575.98px) {
  .site-edge-tab {
    min-height: 4.5rem;
    min-width: 2.15rem;
    padding: 0.5rem 0.35rem;
    border-radius: 8px 0 0 8px;
  }

  .site-edge-tab__label {
    font-size: 0.75rem;
  }
}

/*
 * /danh-muc/ — nút Danh mục trong .site-fab-stack (luôn tải trong store.css).
 * Tránh nút “mất” khi landing.css cache cũ / không đồng bộ staticfiles.
 */
@media (max-width: 767.98px) {
  .site-fab-stack #categoryBrowseOpenFab.site-category-fab.site-fab-circle {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto;
    flex: 0 0 auto !important;
    align-self: flex-end !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 3rem !important;
    min-width: 3rem !important;
    max-width: 3rem !important;
    height: 3rem !important;
    min-height: 3rem !important;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--accent, #0d6efd);
    color: #fff !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    visibility: visible !important;
    opacity: 1 !important;
    /* Giống .site-scroll-fab: một số WebKit không nhận tap nếu không ghi rõ */
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/*
 * =============================================================================
 * #categoryBrowseOffcanvas — panel trượt danh mục (mobile / offcanvas-start)
 * Biến cục bộ + header/body dễ đọc. Cây link bên dưới dùng chung aside + offcanvas.
 * =============================================================================
 */
.category-browse-offcanvas {
  /* Kích thước & lớp nổi */
  width: min(max(100vw - 2rem, 0px), 22rem);
  max-width: 100%;
  z-index: 1050;
  /* Typography & màu vùng nội dung (kế thừa xuống .offcanvas-body) */
  --cat-oc-bg: #f8fafc;
  --cat-oc-text: #1e293b;
  --cat-oc-muted: #64748b;
  --cat-oc-header-bg: #ffffff;
  --cat-oc-border: #e2e8f0;
  --cat-oc-radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.category-browse-offcanvas.offcanvas-start {
  left: 0;
  right: auto;
}

/* Tiêu đề panel — tách rõ với danh sách */
.category-browse-offcanvas .offcanvas-header {
  padding: 0.9rem 1rem;
  background: var(--cat-oc-header-bg);
  border-bottom: 1px solid var(--cat-oc-border);
}

.category-browse-offcanvas .offcanvas-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #0f172a;
}

/* Nội dung cuộn: nền nhạt, chữ đủ lớn, dòng thoáng */
.category-browse-offcanvas .offcanvas-body {
  padding: 1rem 0.85rem 1.35rem;
  /* vh: tương thích rộng; dvh: trừ thanh địa chỉ mobile khi trình duyệt hỗ trợ */
  max-height: min(72vh, calc(100vh - 5.5rem));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--cat-oc-bg);
  color: var(--cat-oc-text);
  font-size: 1rem;
  line-height: 1.55;
}

@supports (height: 100dvh) {
  .category-browse-offcanvas .offcanvas-body {
    max-height: min(72dvh, calc(100dvh - 5.5rem));
  }
}

/* Trùng với tiêu đề offcanvas — ẩn heading phụ trong nav */
.category-browse-offcanvas .category-sidebar-nav .sidebar-heading {
  display: none;
}

.category-sidebar-nav-list,
.category-sidebar-nav-list ul {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.category-sidebar-nav-list li::marker {
  content: none;
}

/* Nhánh con: thụt (Bootstrap ms/ps/border trên <ul> + bổ sung) */
.category-sidebar-nav .category-tree-nested {
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  border-radius: 0 8px 8px 0;
  background: rgba(15, 23, 42, 0.02);
}

.category-sidebar-nav .category-tree-nested .category-tree-nested {
  margin-left: 0.25rem;
}

.category-sidebar-nav a.category-tree-link,
.category-sidebar-nav a.category-tree-link:visited,
.category-sidebar-nav a.category-tree-link:hover,
.category-sidebar-nav a.category-tree-link:active,
.category-sidebar-nav a.category-tree-link:focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.4rem 0.35rem;
  margin: 0;
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-underline-offset: unset !important;
  color: var(--fg) !important;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.category-sidebar-nav .category-tree-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--fg) !important;
  text-decoration: none !important;
}

.category-sidebar-nav .category-tree-link__name,
.category-sidebar-nav .category-tree-link__count {
  text-decoration: none !important;
}

.category-sidebar-nav .category-tree-link__name {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.category-sidebar-nav .category-tree-link__count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #475569 !important;
  border: 1px solid #cbd5e1;
  min-width: 1.85rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* Cấp 1 — gạch ngăn giữa nhóm gốc */
.category-sidebar-nav .category-sidebar-nav-list > li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.category-sidebar-nav .category-sidebar-nav-list > li:last-child {
  border-bottom: none;
}

.category-tree-link--depth-1 {
  font-weight: 600;
  padding: 0.65rem 0.55rem 0.65rem 0.65rem !important;
  margin-bottom: 0;
  border-left: 3px solid var(--accent, #0d6efd);
  box-shadow: none;
}

/* Không chọn: nền trắng — tránh đè lên bg-primary-subtle khi .is-selected */
.category-tree-link--depth-1:not(.is-selected) {
  background: #fff !important;
}

.category-tree-link--depth-1:hover:not(.is-selected) {
  background: rgba(13, 110, 253, 0.06) !important;
}

/* Cha (cấp 1): chữ đậm + màu đậm */
.category-tree-link--depth-1 .category-tree-link__name {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: #0a0f1a !important;
}

.category-tree-link--depth-1 .category-tree-link__count {
  font-size: 0.78rem;
  color: #0f172a !important;
  background: #fff !important;
  border-color: rgba(13, 110, 253, 0.35);
}

/* Cấp 2 — con: nhạt hơn cha, thụt qua .category-tree-nested + padding dòng */
.category-tree-link--depth-2 {
  padding: 0.5rem 0.45rem 0.5rem 0.5rem !important;
  border-left: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.category-sidebar-nav .category-tree-item--depth-2 > .category-tree-link {
  padding-left: 0.65rem !important;
}

.category-tree-link--depth-2 .category-tree-link__name {
  font-weight: 600;
  font-size: 0.93rem;
  color: #334155 !important;
}

.category-tree-link--depth-2 .category-tree-link__count {
  font-size: 0.7rem;
  padding: 0.18rem 0.45rem;
}

.category-sidebar-nav .category-tree-item--depth-3 > .category-tree-link {
  padding-left: 0.85rem !important;
}

.category-sidebar-nav .category-tree-item--depth-4 > .category-tree-link {
  padding-left: 1.1rem !important;
}

.category-sidebar-nav .category-tree-item--depth-5 > .category-tree-link {
  padding-left: 1.35rem !important;
}

.category-sidebar-nav .category-tree-item--depth-6 > .category-tree-link {
  padding-left: 1.55rem !important;
}

.category-tree-link--depth-3 .category-tree-link__name,
.category-tree-link--depth-4 .category-tree-link__name,
.category-tree-link--depth-5 .category-tree-link__name,
.category-tree-link--depth-6 .category-tree-link__name {
  font-weight: 500;
  font-size: 0.88rem;
  color: #64748b !important;
}

.category-tree-link--depth-3 .category-tree-link__count,
.category-tree-link--depth-4 .category-tree-link__count,
.category-tree-link--depth-5 .category-tree-link__count,
.category-tree-link--depth-6 .category-tree-link__count {
  font-size: 0.65rem;
  padding: 0.14rem 0.38rem;
  opacity: 0.98;
}

/* Đang chọn: nền màu rõ + chữ accent */
.category-sidebar-nav .category-tree-link.is-selected .category-tree-link__name {
  color: #0b5ed7 !important;
  font-weight: 700;
}

.category-tree-link--depth-1.is-selected .category-tree-link__name {
  font-weight: 800 !important;
}

/* Nền mục chọn: dùng class Bootstrap bg-primary-subtle trên <a> — chỉ thêm viền nhấn */
.category-sidebar-nav .category-tree-link:not(.category-tree-link--depth-1).is-selected {
  box-shadow: inset 3px 0 0 0 var(--accent, #0d6efd);
}

.category-sidebar-nav .category-tree-link.is-selected:hover {
  filter: brightness(0.98);
}

.category-sidebar-nav .category-tree-link.is-selected .category-tree-link__count {
  background: #cfe2ff !important;
  color: #0b5ed7 !important;
  border-color: rgba(13, 110, 253, 0.45);
}

.category-tree-link--depth-1.is-selected {
  border-left-color: var(--accent, #0d6efd) !important;
}

.category-sidebar-nav .category-tree-link:focus-visible {
  outline: 2px solid rgba(13, 110, 253, 0.55);
  outline-offset: 2px;
}

/*
 * Chỉ trong offcanvas: tăng khoảng cách & cỡ chữ để dễ đọc trên mobile
 * (aside desktop giữ style chung phía trên; rule này override nhẹ khi specificity đủ)
 */
.category-browse-offcanvas .category-sidebar-nav .category-tree-link__name {
  line-height: 1.5;
}

.category-browse-offcanvas .category-sidebar-nav-list > .category-tree-item + .category-tree-item {
  margin-top: 0.15rem;
}

.category-browse-offcanvas .category-tree-nested {
  margin-top: 0.3rem;
  margin-bottom: 0.45rem;
}

.category-browse-offcanvas .category-tree-link--depth-1 .category-tree-link__name {
  font-size: 1.0625rem;
  line-height: 1.45;
}

.category-browse-offcanvas .category-tree-link--depth-2 .category-tree-link__name {
  font-size: 0.97rem;
  line-height: 1.5;
}

.category-browse-offcanvas .category-tree-link--depth-3 .category-tree-link__name,
.category-browse-offcanvas .category-tree-link--depth-4 .category-tree-link__name,
.category-browse-offcanvas .category-tree-link--depth-5 .category-tree-link__name,
.category-browse-offcanvas .category-tree-link--depth-6 .category-tree-link__name {
  font-size: 0.92rem;
  line-height: 1.5;
}

.category-browse-offcanvas .category-sidebar-nav .category-tree-link__count {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
}

.category-browse-offcanvas .category-tree-link--depth-1 .category-tree-link__count {
  font-size: 0.8rem;
}

/* Thanh cuộn mảnh (WebKit) — không chiếm chỗ đọc */
.category-browse-offcanvas .offcanvas-body::-webkit-scrollbar {
  width: 6px;
}

.category-browse-offcanvas .offcanvas-body::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}

.category-browse-offcanvas .offcanvas-body::-webkit-scrollbar-track {
  background: transparent;
}

/* Trang chi tiết sản phẩm — gallery, lightbox, thuộc tính, báo giá (site.js) */
.is-hidden {
  display: none !important;
}

.product-detail--storefront {
  align-items: start;
}

.product-detail__media {
  min-width: 0;
}

/* Cột ảnh: ảnh chính trên, thumbnail một hàng bên dưới (không chia cột ngang) */
.product-detail__media--column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
}

body.page-san-pham section.product-detail-shop-media.product-detail__media {
  overflow-x: visible;
  max-width: 100%;
  min-width: 0;
  /* Trên mobile panel thông tin có z-index:1 và margin âm — nâng gallery để click ảnh / lightbox không bị chặn */
  position: relative;
  z-index: 2;
}

.product-gallery-main__img {
  display: block;
  width: 100%;
  max-height: min(70vh, 520px);
  object-fit: contain;
  background: #f8f9fa;
  cursor: zoom-in;
}

.product-gallery-placeholder {
  min-height: 280px;
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
}

/* Thumbnail: wrapper = vùng cuộn; hàng = grid cột cố định (tránh flex min-width:auto) */
.product-gallery-thumbs-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
}

.product-gallery-thumbs-wrap::-webkit-scrollbar {
  height: 10px;
}

.product-gallery-thumbs-wrap::-webkit-scrollbar-track {
  background: rgba(28, 25, 23, 0.06);
  border-radius: 999px;
}

.product-gallery-thumbs-wrap::-webkit-scrollbar-thumb {
  background: rgba(28, 25, 23, 0.35);
  border-radius: 999px;
}

.product-gallery-thumbs {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: 72px !important;
  gap: 0.5rem;
  align-items: center;
  width: max-content;
  max-width: none;
  box-sizing: border-box;
}

/* Ghi đè store.css global `button { width:100% }` — ô lưới 72px */
.product-gallery-thumbs > .product-gallery-thumb,
.product-gallery-thumbs > button.product-gallery-thumb {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 72px !important;
  min-height: 72px !important;
  box-sizing: border-box;
}

/* Không gộp nút lightbox vào đây — tránh width:auto làm vỡ nút tròn overlay */
.attribute-option-btn {
  width: auto;
  max-width: none;
}

.product-gallery-thumb {
  position: relative;
  padding: 0 !important;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #f1f5f9;
  line-height: 0;
  transition: border-color 0.15s ease;
}

.product-gallery-thumb__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.52);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.product-gallery-thumb.is-active {
  border-color: var(--accent, #0d6efd);
  box-shadow: 0 0 0 1px var(--accent, #0d6efd);
}

.product-gallery-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

/* Giá trị thuộc tính: một hàng, nút bấm; nhiều giá trị thì cuộn ngang */
.product-attribute-values {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
}

.attribute-option-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.attribute-option-btn.is-active {
  border-color: var(--accent, #0d6efd) !important;
  background-color: rgba(13, 110, 253, 0.12) !important;
  color: #0f172a !important;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.35);
}

.attribute-option-btn--color {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.color-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.product-description-body {
  color: #334155;
  line-height: 1.65;
  max-width: 52rem;
}

.product-quote-form .form-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.related-products .related-products__list {
  margin-top: 0.5rem;
}

/*
 * Sản phẩm liên quan: CSS Grid (class related-products__list — tránh tên chứa "grid" trùng utility).
 * 1 cột · ≥768px: 2 · ≥992px (lg): 4 cùng hàng — khớp desktop rộng phổ biến.
 */
.related-products--four .related-products__list {
  display: grid;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .related-products--four .related-products__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .related-products--four .related-products__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.related-products--four .related-products__item {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.related-products--four .related-products__list .product-card {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

/* Trang sản phẩm — bố cục nhận báo giá (/san-pham/...) */
.product-quote-hero {
  margin-bottom: 0;
}

.product-detail-page {
  padding-top: 1rem;
}

.product-detail--quote {
  align-items: start;
}

/* PDP: article = grid 2 cột — SP liên quan full-width span cả hai cột */
article.product-detail.product-detail--atelier > .related-products,
.product-detail--atelier > .related-products {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  min-width: 0;
}

@media (min-width: 992px) {
  .product-detail--quote {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.25rem;
  }

  .product-detail__info--quote {
    position: sticky;
    top: 1rem;
  }
}

.product-gallery-main--quote .product-gallery-main__img {
  max-height: min(78vh, 640px);
  min-height: 240px;
}

.product-gallery-hint {
  max-width: 36rem;
}

@media (min-width: 768px) {
  .product-quote-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
    align-items: start;
  }

  .product-quote-form .product-quote-form__field--full {
    grid-column: 1 / -1;
  }

  .product-quote-form__actions {
    grid-column: 1 / -1;
  }
}

/* Trang chi tiết sản phẩm — theme “atelier” (thủ công, ấm, typography rõ) */
body.page-san-pham {
  --pd-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --pd-display: "Fraunces", Georgia, "Times New Roman", serif;
  --pd-accent: #92400e;
  --pd-accent-hover: #b45309;
  --pd-accent-soft: rgba(146, 64, 14, 0.12);
  --pd-ink: #1c1917;
  --pd-muted: #78716c;
  --pd-bg: #f0ebe4;
  --pd-card: #fffefb;
  --pd-line: rgba(28, 25, 23, 0.1);
  --pd-radius: 16px;
  --pd-shadow: 0 4px 24px rgba(28, 25, 23, 0.06);
  --pd-shadow-lg: 0 20px 48px rgba(28, 25, 23, 0.06);
  font-family: var(--pd-font);
  color: var(--pd-ink);
}

body.page-san-pham .site-main {
  background-color: var(--pd-bg);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(146, 64, 14, 0.04), transparent);
}

.product-detail-page--atelier {
  padding-bottom: 0.5rem;
}

@media (max-width: 991.98px) {
  body.page-san-pham {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Breadcrumb */
.product-quote-hero--atelier {
  background: transparent;
  border: none;
}

.product-breadcrumb-wrap {
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 254, 251, 0.88);
  border: 1px solid var(--pd-line);
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.04);
  backdrop-filter: blur(8px);
}

.product-breadcrumb-atelier .breadcrumb-item a {
  color: var(--pd-muted);
}

.product-breadcrumb-atelier .breadcrumb-item.active {
  color: var(--pd-ink);
  max-width: 38vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ảnh full-bleed mobile */
@media (max-width: 991.98px) {
  .product-detail-page--atelier .product-detail-shop-media {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
  }
}

/* Không tạo thanh cuộn trong khung ảnh chính — chỉ hàng thumbnail bên dưới cuộn ngang */
.product-gallery-carousel {
  touch-action: manipulation;
  background: var(--pd-card);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.product-gallery-main.product-gallery-main--quote {
  overflow: hidden;
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .product-gallery-main--quote {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #faf8f5 0%, #ffffff 55%);
    border-radius: 0;
  }

  .product-gallery-main--quote .product-gallery-main__img {
    max-height: none;
    height: 100%;
    width: 100%;
    object-fit: contain;
    border: none;
    border-radius: 0;
  }

  .product-gallery-main--quote .product-gallery-placeholder {
    width: 100%;
    min-height: 0;
    flex: 1;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 992px) {
  .product-detail-shop-media {
    background: var(--pd-card);
    border-radius: var(--pd-radius);
    padding: 0.85rem;
    border: 1px solid var(--pd-line);
    box-shadow: var(--pd-shadow);
  }

  .product-gallery-main--quote .product-gallery-main__img {
    border-radius: 12px;
  }
}

/* Panel thông tin */
@media (max-width: 991.98px) {
  .product-detail-shop-info-panel {
    background: var(--pd-card);
    border-radius: 14px 14px 0 0;
    margin-top: -10px;
    padding: 1.35rem 1.1rem 1.6rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 -8px 32px rgba(28, 25, 23, 0.07);
    border: 1px solid var(--pd-line);
    border-bottom: none;
  }

  .product-detail--quote {
    gap: 0;
  }
}

@media (min-width: 992px) {
  .product-detail-shop-info-panel {
    background: var(--pd-card);
    border-radius: var(--pd-radius);
    padding: 1.65rem 1.5rem;
    box-shadow: var(--pd-shadow);
    border: 1px solid var(--pd-line);
  }
}

.product-detail-title {
  font-family: var(--pd-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--pd-ink);
}

.product-detail-lead {
  line-height: 1.55;
  font-size: 0.95rem;
}

.product-detail-eyebrow__sep {
  color: var(--pd-muted);
  opacity: 0.8;
}

.product-quote-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--pd-accent-soft);
  color: var(--pd-accent);
  border: 1px solid rgba(146, 64, 14, 0.2);
}

.product-quote-category {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pd-muted);
}

.product-quote-category:hover {
  color: var(--pd-accent);
}

.product-section-heading {
  font-family: var(--pd-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--pd-ink);
  margin: 0 0 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--pd-line);
}

.product-section-heading--quote {
  border-bottom: none;
  padding-bottom: 0;
}

.product-section-heading--related {
  border-bottom: none;
  padding-left: 0.5rem;
  border-left: 3px solid var(--pd-accent);
}

.product-section-heading--attrs {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0.35rem;
}

/* Nút chính kiểu “Add to cart” → Nhận báo giá */
.product-pdp-cta {
  margin-top: 1.25rem;
}

.product-pdp-cta__btn {
  display: block;
  width: 100% !important;
  max-width: 100%;
  margin: 0;
  padding: 0.95rem 1.25rem;
  border: 1px solid #0d6efd !important;
  border-radius: 6px;
  background: #0d6efd !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
}

.product-pdp-cta__btn:hover {
  background: #0b5ed7 !important;
  color: #fff !important;
}

.product-pdp-cta__btn:active {
  transform: scale(0.99);
}

.product-attribute-group__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pd-muted);
  margin-bottom: 0.5rem;
}

body.page-san-pham .product-attributes--pdp .product-attribute-group__label,
body.page-san-pham .product-attributes--pdp label.product-attribute-group__label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: #475569;
}

/* PDP — khối thuộc tính: đảm bảo select có thể tương tác, không bị che */
body.page-san-pham .product-attributes.product-attributes--pdp {
  position: relative;
  z-index: 2;
}

/* PDP — giá trị thuộc tính dạng <select> (Bootstrap .form-select) */
body.page-san-pham .product-attributes--pdp .product-attribute-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 2.75rem 0.5rem 0.9rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: #0f172a;
  background-color: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.page-san-pham .product-attributes--pdp .product-attribute-select:hover {
  border-color: #cbd5e1;
}

body.page-san-pham .product-attributes--pdp .product-attribute-select:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
  outline: none;
}

body.page-san-pham .product-attributes--pdp label.product-attribute-group__label {
  display: block;
  margin-bottom: 0.4rem;
}

.product-quote-form__title {
  font-family: var(--pd-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--pd-ink);
}

.product-price-shop {
  font-family: var(--pd-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--pd-accent);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.product-price-shop--contact {
  color: var(--pd-ink);
}

.product-price-shop__currency {
  font-size: 0.65em;
  font-weight: 600;
  margin-right: 0.12em;
  vertical-align: 0.08em;
}

.product-attribute-group .product-attribute-values {
  gap: 0.5rem;
  padding-bottom: 0.35rem;
}

/* Giữ style atelier cho trường hợp không nằm trong .product-attributes--pdp (nếu có sau này) */
body.page-san-pham .attribute-option-btn:not(.attribute-option-btn--pdp) {
  min-height: 44px;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--pd-line);
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

body.page-san-pham .attribute-option-btn:not(.attribute-option-btn--pdp).is-active {
  border-color: var(--pd-accent) !important;
  background-color: rgba(146, 64, 14, 0.12) !important;
  color: var(--pd-ink) !important;
  box-shadow: 0 0 0 1px var(--pd-accent);
}

.product-variant-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.25);
  border-radius: 8px;
  color: var(--pd-ink);
  padding: 0.5rem 0.75rem;
}

.product-variant-pill__label {
  font-weight: 600;
  font-size: 0.8rem;
  color: #0d6efd;
}

.product-variant-pill__value {
  font-weight: 500;
  font-size: 0.9rem;
}

.product-variant-note {
  font-style: italic;
}

.quote-wizard-submit-btn {
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 210px;
}

.product-quote-placeholder--atelier {
  margin-top: 1rem;
  padding: 1.25rem 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(146, 64, 14, 0.35);
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.product-quote-placeholder__text {
  font-size: 0.9rem;
  color: var(--pd-muted);
}

.product-quote-card--atelier {
  border-radius: var(--pd-radius);
  background: var(--pd-card);
  border: 1px solid var(--pd-line);
  box-shadow: var(--pd-shadow-lg);
  overflow: hidden;
  position: relative;
}

.product-quote-card--atelier::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pd-accent), #d97706, var(--pd-accent));
  opacity: 0.85;
}

.product-quote-card__inner {
  position: relative;
}

.product-quote-lead {
  font-size: 0.88rem !important;
  line-height: 1.5;
}

body.page-san-pham .product-quote-form--atelier-pdp .product-quote-form__field {
  margin-bottom: 1.1rem;
}

body.page-san-pham .product-quote-form--atelier-pdp .form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pd-ink);
  margin-bottom: 0.35rem;
}

body.page-san-pham .product-quote-form--atelier-pdp .form-control,
body.page-san-pham .product-quote-form--atelier-pdp .form-select {
  border-radius: 10px;
  border: 1px solid rgba(28, 25, 23, 0.14);
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  background: #fffefb;
}

body.page-san-pham .product-quote-form--atelier-pdp textarea.form-control {
  min-height: 5.5rem;
  resize: vertical;
}

body.page-san-pham .product-quote-form .form-control:focus,
body.page-san-pham .product-quote-form .form-select:focus {
  border-color: var(--pd-accent);
  box-shadow: 0 0 0 0.2rem rgba(146, 64, 14, 0.12);
}

.product-quote-submit {
  border-radius: 10px;
  padding: 0.7rem 1.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #0f172a !important;
  border: 1px solid #0f172a !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.product-quote-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  background: #1e293b !important;
  border-color: #1e293b !important;
}

/* Modal wizard báo giá (PDP) */
.quote-wizard-modal .modal-content.quote-wizard-modal__content {
  border-radius: var(--pd-radius);
  border: 1px solid var(--pd-line);
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.16);
  overflow: hidden;
}

.quote-wizard-modal .quote-wizard-modal__header {
  padding-bottom: 0.5rem;
}

.quote-wizard-modal .modal-body {
  padding-top: 0.5rem;
}

@media (max-width: 575.98px) {
  .quote-wizard-modal .modal-dialog {
    margin: 0.65rem;
  }
}

.product-description-section--atelier,
.related-products--atelier {
  background: var(--pd-card);
  border-radius: var(--pd-radius);
  padding: 1.35rem 1.1rem !important;
  margin-top: 1rem !important;
  border: 1px solid var(--pd-line);
  box-shadow: var(--pd-shadow);
}

.product-section-heading--desc {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

@media (min-width: 992px) {
  .product-description-section--atelier,
  .related-products--atelier {
    padding: 1.65rem 1.5rem !important;
    margin-top: 1.5rem !important;
  }
}

.product-description-body {
  color: #44403c;
}

/* Thanh CTA cố định — mobile */
.product-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  pointer-events: none;
}

.product-sticky-cta__safe {
  pointer-events: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(to top, rgba(255, 254, 251, 0.97), rgba(255, 254, 251, 0.88));
  border-top: 1px solid var(--pd-line);
  box-shadow: 0 -8px 32px rgba(28, 25, 23, 0.08);
  backdrop-filter: blur(10px);
}

.product-sticky-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.65rem 1rem 0.75rem;
}

.product-sticky-cta__info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.product-sticky-cta__price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pd-accent);
  line-height: 1.2;
  font-family: var(--pd-display);
}

.product-sticky-cta__sub {
  font-size: 0.7rem;
  color: var(--pd-muted);
}

.product-sticky-cta__btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.45rem 1.15rem;
  border: none;
  border-radius: 6px;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  max-width: 52%;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
}

.product-sticky-cta__btn:hover {
  background: #0b5ed7;
  color: #fff;
}

.product-sticky-cta__btn:active {
  filter: brightness(0.95);
}

.product-desc-anchor {
  color: var(--pd-accent);
  font-weight: 600;
  font-size: 0.88rem;
}

.product-desc-anchor:hover {
  text-decoration: underline !important;
}

/* Ghi đè rule cũ (card bootstrap) */
.product-detail--quote .product-quote {
  border-left: none !important;
}



/* === Merged from navbar-bootstrap.css (single request; avoids 404 if deploy omits file) === */
/**
 * Bootstrap navbar + mega menu — storefront (Thêu Công Khải)
 * Màu teal / xám khớp theme cũ
 */

:root {
  --bs-mega-teal: #5bb69e;
  --bs-mega-teal-hover: #4a9d86;
  --bs-mega-sub: #6b6b6b;
  /* Mega menu — tông tím thương hiệu + chữ dễ đọc */
  --mega-brand: #5b21b6;
  --mega-brand-hover: #6d28d9;
  --mega-brand-soft: rgba(91, 33, 182, 0.08);
  --mega-brand-border: rgba(91, 33, 182, 0.18);
  --mega-text: #1f2937;
  --mega-text-muted: #4b5563;
}

.navbar-store-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Desktop: .site-navbar-inner trong <nav> — chỉ ≥lg */
.site-navbar-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo chỉ ảnh — thanh mobile (ngoài .navbar) */
.site-navbar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  text-decoration: none;
  line-height: 0;
}

/* Hàng mobile: củng cố flex (template đã có inline) */
@media (max-width: 991.98px) {
  .site-navbar-mobile-toolbar {
    max-width: 100%;
    overflow-x: clip;
  }

  .site-navbar-mobile-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 0.35rem;
  }

  .site-navbar-mobile-row .site-navbar-title-mobile {
    font-weight: 600;
    font-size: clamp(0.78rem, 2.6vw, 1rem);
    line-height: 1.2;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Tên thương hiệu mobile — nổi bật */
  .site-navbar-title-mobile--brand {
    font-weight: 800 !important;
    font-size: clamp(0.95rem, 3.4vw, 1.2rem) !important;
    letter-spacing: 0.06em !important;
    line-height: 1.15 !important;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
  }
}

/* Header desktop: logo + chữ */
.navbar-store-container .site-navbar-brand {
  min-width: 0;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  line-height: 1.25;
}

/* —— Desktop (≥lg): flex — logo | menu ngang —— */
@media (min-width: 992px) {
  .site-header .navbar.navbar-expand-lg > .navbar-store-container.site-navbar-inner {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
  }

  .navbar-store-container .site-navbar-brand {
    flex: 0 1 auto;
    max-width: none;
    margin-right: 0;
    width: auto;
  }

  /* Menu desktop: luôn một dòng, không xuống hàng */
  #storeNavbarDesktop .navbar-nav {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }

  #storeNavbarDesktop .nav-item {
    white-space: nowrap;
  }
}

/* Nút ☰ desktop (nếu có) + mobile toolbar */
.navbar-store-container .site-navbar-toggler,
.site-navbar-mobile-toolbar .site-navbar-toggler {
  flex-shrink: 0;
  flex-grow: 0;
  padding: 0.35rem 0.5rem;
  box-sizing: border-box;
}

.site-navbar-logo {
  display: block;
  flex-shrink: 0;
  height: 2.75rem;
  width: auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  max-width: 3.25rem;
  object-fit: contain;
}

/*
 * Mobile: phong cách Bootstrap Docs — nền tím; logo | tên | ☰ cùng hàng; chữ/icon trắng.
 */
@media (max-width: 991.98px) {
  .site-header.bg-white {
    background-color: #7952b3 !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08) !important;
  }

  .site-header .navbar.navbar-light {
    background-color: transparent !important;
    --bs-navbar-color: rgba(255, 255, 255, 0.92);
    --bs-navbar-brand-color: #fff;
    --bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.55);
  }

  .site-header .site-navbar-title-mobile {
    color: #fff !important;
  }

  .site-header .site-navbar-title-mobile--brand {
    color: #fff !important;
    text-shadow:
      0 1px 0 rgba(0, 0, 0, 0.22),
      0 2px 8px rgba(0, 0, 0, 0.25),
      0 0 1px rgba(255, 255, 255, 0.5);
  }

  .site-header .site-navbar-logo {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  }

  /* Nút menu mobile: nền sáng + viền dày — icon SVG trắng rõ */
  .site-header .site-navbar-mobile-toolbar .site-navbar-menu-btn.site-navbar-toggler {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.22) !important;
    border: 2px solid rgba(255, 255, 255, 0.95) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.65rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 0;
  }

  .site-header .site-navbar-mobile-toolbar .site-navbar-menu-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .site-header .site-navbar-mobile-toolbar .site-navbar-menu-btn:active {
    background: rgba(255, 255, 255, 0.32) !important;
  }

  .site-header .site-navbar-mobile-toolbar .site-navbar-menu-icon {
    display: block;
    width: 1.65rem;
    height: 1.65rem;
    flex-shrink: 0;
  }
}

@media (min-width: 992px) {
  .site-header .navbar-brand.site-navbar-brand.text-dark {
    color: rgba(33, 37, 41, 0.9) !important;
  }

  .site-header .site-navbar-brand .site-navbar-brand-text {
    font-weight: 800;
    font-size: clamp(1.05rem, 1.1rem + 0.2vw, 1.25rem);
    letter-spacing: 0.04em;
    color: #1a1a1a !important;
  }

  .site-header .site-navbar-logo {
    box-shadow: none;
  }
}

/* Mega: nút Sản phẩm (button) — giống nav-link */
.dropdown-mega > button.nav-link.dropdown-toggle {
  cursor: pointer;
  color: rgba(33, 37, 41, 0.85);
  font-weight: 500;
}

.dropdown-mega > button.nav-link.dropdown-toggle:focus-visible {
  outline: 2px solid rgba(91, 182, 158, 0.55);
  outline-offset: 2px;
}

/* Mobile: panel trượt từ phải (Bootstrap offcanvas-end) */
.offcanvas.offcanvas-store-nav {
  width: min(20rem, 92vw);
  border-left: 1px solid #e8e8e8;
}

.offcanvas-store-nav .mega-offcanvas-inner {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.offcanvas-store-nav button[data-bs-toggle="collapse"] .small {
  display: inline-block;
  transition: transform 0.2s ease;
}

.offcanvas-store-nav button[data-bs-toggle="collapse"][aria-expanded="true"] .small {
  transform: rotate(-180deg);
}

/* Desktop: hover mở dropdown (bổ sung cho click của Bootstrap) */
@media (min-width: 992px) {
  .navbar .dropdown-mega:hover > .dropdown-menu {
    display: block;
  }

  .navbar .dropdown-mega .nav-link.dropdown-toggle.show {
    background-color: rgba(91, 33, 182, 0.1);
    border-radius: 0.35rem;
    color: var(--mega-brand) !important;
  }

  .navbar .dropdown-mega:hover > .nav-link.dropdown-toggle {
    background-color: rgba(91, 33, 182, 0.08);
    border-radius: 0.35rem;
    color: var(--mega-brand) !important;
  }
}

/* —— Mega panel: nền sáng + viền tím nhẹ, chữ lớn dễ đọc —— */
.dropdown-mega .mega-dropdown-menu {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  margin-top: 0 !important;
  border-top: 2px solid var(--mega-brand-border) !important;
  background: linear-gradient(180deg, #faf5ff 0%, #f8fafc 42%, #ffffff 100%);
  z-index: 1040;
  box-shadow:
    0 16px 48px rgba(15, 23, 42, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.dropdown-mega .mega-dropdown-menu .container {
  max-width: 1200px;
}

/* Ghi đè màu link mặc định (store.css / Bootstrap) trong mega */
.dropdown-mega .mega-dropdown-menu a.mega-cat-title__link,
.dropdown-mega .mega-dropdown-menu a.mega-sub-link {
  text-decoration: none !important;
}

.mega-dropdown-inner-wrap {
  padding-bottom: 0.35rem;
}

.mega-menu-parent-row {
  --bs-gutter-x: 1.15rem;
  --bs-gutter-y: 1.15rem;
}

/* Thẻ từng nhóm danh mục */
.mega-parent-card {
  background: #fff;
  border: 1px solid var(--mega-brand-border);
  border-radius: 14px;
  padding: 1.1rem 1.05rem 0.95rem;
  box-shadow: 0 2px 14px rgba(91, 33, 182, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mega-parent-card:hover {
  border-color: rgba(91, 33, 182, 0.35);
  box-shadow: 0 10px 28px rgba(91, 33, 182, 0.1);
}

.mega-parent-card--mobile {
  box-shadow: none;
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
}

/* Tiêu đề nhóm — không ép chữ hoa quá nhỏ; dễ quét mắt */
.mega-cat-title {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.02rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.4;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid rgba(91, 33, 182, 0.22);
}

.mega-cat-title__link {
  color: var(--mega-brand) !important;
  display: block;
}

.mega-cat-title__link:hover,
.mega-cat-title__link:focus {
  color: var(--mega-brand-hover) !important;
}

.mega-sub-list {
  border-top: none;
  margin-top: 0.35rem;
}

.mega-sub-item {
  border-bottom: 1px solid rgba(229, 231, 235, 0.95);
}

.mega-sub-item:last-child {
  border-bottom: none;
}

.mega-sub-link {
  color: var(--mega-text-muted) !important;
  font-weight: 500;
  font-size: clamp(0.875rem, 0.82rem + 0.15vw, 0.95rem);
  letter-spacing: 0.01em;
  line-height: 1.55;
  padding: 0.5rem 0.35rem 0.5rem 0 !important;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.mega-sub-link:hover,
.mega-sub-link:focus {
  color: var(--mega-brand) !important;
  background: var(--mega-brand-soft) !important;
}

.mega-dropdown-footer {
  border-top: 1px solid var(--mega-brand-border) !important;
}

.mega-all-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%) !important;
  border: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding: 0.55rem 1.4rem !important;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(91, 33, 182, 0.35);
}

.mega-all-btn:hover,
.mega-all-btn:focus {
  color: #fff !important;
  filter: brightness(1.06);
  box-shadow: 0 6px 22px rgba(91, 33, 182, 0.42);
}
