/* ============================================================
   Bảo Vy – Thiết bị vệ sinh | Stylesheet
   ============================================================ */

/* ---------- Biến & reset ---------- */
:root {
  --brand: #0b7285;
  --brand-600: #0a6373;
  --brand-700: #084d5c;
  --brand-soft: #e8f5f8;
  --brand-softer: #f3fafc;
  --accent: #f97316;
  --accent-soft: #fff1e6;
  --ink: #103039;
  --muted: #5f7a83;
  --line: #e0ebef;
  --bg: #f7fafb;
  --white: #fff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(8, 52, 64, 0.05), 0 6px 18px rgba(8, 52, 64, 0.06);
  --shadow-md: 0 18px 40px rgba(8, 52, 64, 0.14);
  --container: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid rgba(11, 114, 133, 0.35);
  outline-offset: 2px;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  box-shadow: 0 6px 14px rgba(11, 114, 133, 0.25);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.logo-text small {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 500;
  color: #33555f;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.2s ease;
}

.main-nav a:hover::after,
.main-nav a.is-active::after {
  width: 100%;
}

.main-nav a.is-active {
  color: var(--brand);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hotline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  color: var(--brand-700);
  font-size: 14.5px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.hotline-link:hover {
  background: var(--brand);
  color: #fff;
}

.hotline-link svg {
  width: 18px;
  height: 18px;
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.cart-link:hover {
  background: #d9eff4;
}

.cart-link svg {
  width: 19px;
  height: 19px;
}

.cart-count {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 114, 133, 0.24);
}

.btn-primary:hover {
  background: var(--brand-600);
  box-shadow: 0 10px 22px rgba(11, 114, 133, 0.3);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #0a2229;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-sm {
  padding: 10px 16px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #eef9fb 0%, #f7fafb 55%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 520px;
  height: 520px;
  right: -160px;
  top: -200px;
  background: radial-gradient(circle, rgba(14, 155, 179, 0.18), transparent 65%);
}

.hero::after {
  width: 380px;
  height: 380px;
  left: -140px;
  bottom: -220px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12), transparent 65%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 52px;
  align-items: center;
  padding: 72px 0 84px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 4.6vw, 56px);
  letter-spacing: -0.03em;
}

.hero-copy p {
  max-width: 52ch;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions .btn:hover {
  transform: translateY(-2px);
}

.hero-actions .btn:active {
  transform: translateY(0);
}

.hero-actions .btn-primary:hover {
  background: var(--brand-700);
  box-shadow: 0 16px 30px rgba(11, 114, 133, 0.36);
}

.hero-actions .btn-ghost:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-700);
  box-shadow: 0 14px 26px rgba(11, 114, 133, 0.18);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats li {
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  font-size: 22px;
  color: var(--brand-700);
}

.hero-stats span {
  font-size: 13px;
  color: var(--muted);
}

.hero-media {
  position: relative;
}

/* Quầng gradient nhẹ phía sau ảnh, hơi lệch để ảnh nổi lên */
.hero-media::before {
  content: "";
  position: absolute;
  inset: 24px -20px -20px 24px;
  border-radius: 30px;
  background: linear-gradient(140deg, #0e9bb3 0%, #58c7e8 46%, #f9a35b 100%);
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
}

.hero-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 54px -24px rgba(8, 52, 64, 0.5), 0 10px 24px rgba(8, 52, 64, 0.12);
}

.hero-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  border-radius: 24px;
  transition: transform 0.6s ease;
}

.hero-media:hover .hero-frame img {
  transform: scale(1.04);
}

@keyframes heroTagFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.hero-tag {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  animation: heroTagFloat 5s ease-in-out infinite;
}

.hero-tag span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-tag strong {
  font-size: 17px;
  color: var(--brand);
}

/* ---------- Cam kết / tiện ích ---------- */
.features {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  padding: 30px 0;
}

.feature {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.feature-icon svg {
  width: 23px;
  height: 23px;
}

.feature strong {
  display: block;
  font-size: 14.5px;
}

.feature span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Section chung ---------- */
.section {
  padding: 70px 0;
}

/* Bù chiều cao header sticky khi nhảy tới anchor (#san-pham, #gioi-thieu, #lien-he) */
section[id] {
  scroll-margin-top: 96px;
}

.section--soft {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.section-head h2 {
  margin-top: 12px;
  font-size: clamp(26px, 3vw, 36px);
}

.section-head p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
}

/* ============================================================
   Danh mục sản phẩm (trang san-pham.html) – banner + sidebar dọc
   Bố cục lấy cảm hứng từ jomoo.vn: cột danh mục bên trái, lưới
   sản phẩm bên phải, ảnh banner lớn phía trên.
   ============================================================ */

/* ---------- Banner danh mục ---------- */
.catalog-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 36px;
  margin-top: 18px;
  padding: 34px 40px;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(125deg, #06404d 0%, #0b7285 48%, #1195ae 100%);
  color: #fff;
  box-shadow: 0 26px 52px -26px rgba(8, 52, 64, 0.65);
}

.catalog-banner::before,
.catalog-banner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.catalog-banner::before {
  width: 420px;
  height: 420px;
  top: -190px;
  right: 8%;
  background: radial-gradient(circle, rgba(129, 226, 245, 0.35), transparent 65%);
}

.catalog-banner::after {
  width: 320px;
  height: 320px;
  bottom: -190px;
  left: -90px;
  background: radial-gradient(circle, rgba(249, 163, 91, 0.3), transparent 66%);
}

.catalog-banner-copy {
  position: relative;
  z-index: 1;
  max-width: 56ch;
}

.catalog-banner .eyebrow {
  background: rgba(255, 255, 255, 0.16);
  color: #eafaff;
}

.catalog-banner h1 {
  margin: 14px 0 12px;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.02em;
}

.catalog-banner-copy p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
}

.catalog-banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.catalog-banner-tags li {
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-banner-media {
  position: relative;
  z-index: 1;
  padding: 10px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.65);
}

/* Ảnh banner đổi theo danh mục đang chọn (js/catalog.js).
   object-fit: contain để ảnh sản phẩm không bị cắt mất phần trên/dưới;
   khung trắng bao ngoài nên phần đệm hai bên trông như một tấm ảnh. */
.catalog-banner-media img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

/* Ảnh chụp cảnh phòng tắm (khai báo fit: 'cover' trong js/catalog.js) phủ kín
   khung; ảnh sản phẩm giữ object-fit: contain trên nền trắng. */
.catalog-banner-media img.is-cover {
  object-fit: cover;
  background: #e7eef2;
}

/* Danh mục khai báo banner null (hiện là Bồn rửa bát, Giàn phơi thông minh vì chỉ
   có poster thông số / ảnh chụp lắp đặt): banner chỉ còn phần chữ */
.catalog-banner--no-media {
  grid-template-columns: 1fr;
}

.catalog-banner--no-media .catalog-banner-media {
  display: none;
}

/* ---------- Bố cục 2 cột: sidebar + danh sách ---------- */
.catalog-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  margin-top: 40px;
}

.catalog-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  align-content: start;
  /* min-width: 0 để dải danh mục cuộn ngang trên mobile không đẩy cả trang rộng ra */
  min-width: 0;
  gap: 18px;
}

.sidebar-card {
  min-width: 0;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding-left: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar-title svg {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.cat-nav {
  display: grid;
  gap: 3px;
}

.cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #294f5a;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cat-link .cat-label {
  flex: 1;
  min-width: 0;
}

.cat-link .cat-count {
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-softer);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Mũi tên ">" vẽ bằng viền để không phải chèn thêm icon */
.cat-link::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.4;
  transition: opacity 0.18s ease;
}

.cat-link:hover {
  background: var(--brand-softer);
  color: var(--brand-700);
}

.cat-link:hover::after {
  opacity: 0.8;
}

.cat-link.is-active {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 700;
}

.cat-link.is-active::after {
  opacity: 0.9;
}

.cat-link.is-active .cat-count {
  background: var(--brand);
  color: #fff;
}

/* Thẻ tư vấn dưới cột danh mục */
.sidebar-promo {
  padding: 20px 18px;
  border-radius: var(--radius);
  background: linear-gradient(155deg, #0b7285, #083d49);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar-promo strong {
  display: block;
  font-size: 15px;
}

.sidebar-promo p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.sidebar-promo .btn {
  margin-top: 14px;
}

.sidebar-promo .btn-ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-promo .btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* ---------- Cột phải: tiêu đề danh mục + lưới ---------- */
.catalog-main {
  min-width: 0;
  scroll-margin-top: 130px;
}

.catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.catalog-head h2 {
  font-size: clamp(22px, 2.4vw, 30px);
}

.catalog-head p {
  margin-top: 7px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 14.5px;
}

.catalog-total {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Huy hiệu HOT cho SKU có is_hot: true (đứng sau .badge nên tăng độ ưu tiên) */
.badge.badge--hot {
  background: var(--brand);
  box-shadow: 0 4px 10px rgba(11, 114, 133, 0.35);
}

/* ---------- Nút "Xem tất cả sản phẩm" ở trang chủ ---------- */
.featured-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  text-align: center;
}

.featured-more .btn {
  padding: 15px 34px;
  font-size: 16px;
}

.featured-more .btn svg {
  width: 18px;
  height: 18px;
}

.featured-more .btn:hover {
  transform: translateY(-2px);
}

.featured-more-note {
  color: var(--muted);
  font-size: 13.5px;
}

.result-count {
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Tìm kiếm & sắp xếp ---------- */
.product-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-field input::placeholder {
  color: #8fa8b0;
}

.search-field input:hover {
  border-color: #c3d9e0;
}

.search-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.14);
}

.sort-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 13.5px;
  color: var(--muted);
}

.sort-field select {
  height: 44px;
  padding: 0 38px 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f7a83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: 14px;
  color: #3c606b;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sort-field select:hover {
  border-color: #c3d9e0;
}

.sort-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.14);
}

/* ---------- Nút mở modal Bộ lọc ---------- */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #3c606b;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease;
}

.filter-toggle svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.filter-toggle:hover {
  border-color: #c3d9e0;
}

.filter-toggle:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.14);
}

.filter-toggle.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-700);
}

.filter-toggle-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.grid-empty {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--brand-softer);
  text-align: center;
}

.grid-empty p {
  margin-bottom: 18px;
  color: var(--muted);
}

/* ---------- Lưới sản phẩm ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: #cfe4ea;
  box-shadow: var(--shadow-md);
}

/* Khung ảnh thumbnail: tỷ lệ 1:1 để mọi thẻ sản phẩm cao bằng nhau,
   nền trắng lấp khoảng trống; ảnh dùng object-fit: contain nên KHÔNG bị
   cắt mất phần trên/dưới (không còn height cố định). */
.card-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #fff;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Bỏ hiệu ứng phóng to khi hover: ảnh contain mà scale() sẽ bị khung cắt
   mất viền, trái với yêu cầu hiển thị đủ ảnh. */

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.35);
}

/* Nhãn "-40%" của sản phẩm khuyến mãi: đặt góc phải để không đè huy hiệu
   HOT / Đặt trước ở góc trái (xem old_price trong js/data.js). */
.badge--sale {
  left: auto;
  right: 12px;
  background: #e03131;
  box-shadow: 0 4px 10px rgba(224, 49, 49, 0.35);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.card-cat {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.card-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.card-name a:hover {
  color: var(--brand);
}

.card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.price {
  font-size: 19px;
  font-weight: 700;
  color: #d9480f;
}

.price-old {
  font-size: 13.5px;
  color: #94a9b1;
  text-decoration: line-through;
}

/* Giá 0 / chưa niêm yết ⇒ "Liên hệ báo giá" */
.price--contact {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-actions .btn {
  flex: 1;
}

/* ---------- Giới thiệu ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.about-grid h2 {
  margin: 14px 0 16px;
  font-size: clamp(26px, 3vw, 34px);
}

.about-grid p {
  margin-bottom: 18px;
  color: var(--muted);
}

/* Phần giới thiệu một cột (không còn khối thẻ số liệu bên phải) */
.about-grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
}

.check-list {
  display: grid;
  gap: 11px;
  margin-bottom: 26px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
  font-size: 15px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.about-card:nth-child(2) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.about-card:nth-child(2) span {
  color: rgba(255, 255, 255, 0.8);
}

.about-card:nth-child(3) {
  background: var(--brand-soft);
  border-color: transparent;
}

.about-card strong {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.about-card span {
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Video review (facade YouTube) ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 24px;
}

.video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Khung 16:9 giữ đúng tỉ lệ cho cả ảnh thumbnail lẫn iframe */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(140deg, #0b3f4c, #0b7285 55%, #0e93a9);
  box-shadow: 0 16px 32px -18px rgba(8, 52, 64, 0.55);
  transition: transform 0.22s ease, box-shadow 0.25s ease;
}

.video-card:hover .video-frame {
  transform: translateY(-4px);
  box-shadow: 0 22px 42px -18px rgba(8, 52, 64, 0.55);
}

.video-facade {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-facade:hover .video-thumb,
.video-facade:focus-visible .video-thumb {
  transform: scale(1.05);
}

/* Lớp phủ tối nhẹ để nút play nổi rõ trên mọi thumbnail */
.video-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 26, 33, 0.05), rgba(4, 26, 33, 0.45));
  pointer-events: none;
}

.video-play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-700);
  box-shadow: 0 12px 26px rgba(4, 26, 33, 0.35);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.video-play svg {
  width: 24px;
  height: 24px;
  margin-left: 3px; /* cân quang học cho tam giác play */
  fill: currentColor;
}

.video-facade:hover .video-play,
.video-facade:focus-visible .video-play {
  transform: scale(1.1);
  background: var(--brand);
  color: #fff;
}

/* Vòng sáng quanh nút play khi điều hướng bằng bàn phím
   (outline mặc định bị khung overflow:hidden cắt mất) */
.video-facade:focus-visible .video-play {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 12px 26px rgba(4, 26, 33, 0.35);
}

/* iframe chỉ được chèn khi khách bấm play (xem js/video-review.js) */
.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-title {
  /* Giữ 2 dòng để tiêu đề các thẻ thẳng hàng dù ngắn/dài;
     tiêu đề dài hơn bị cắt bằng “…” (xem đầy đủ qua tooltip title) */
  min-height: 2.8em;
  font-size: 16px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 13px;
  color: var(--muted);
}

/* Link “Mở trên YouTube” dưới video: a mặc định là color inherit + không gạch
   chân nên phải tự làm nổi để khách thấy đây là lối thoát khi iframe bị chặn */
.video-meta a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.video-meta a:hover,
.video-meta a:focus-visible {
  color: var(--brand-700);
  text-decoration-thickness: 2px;
}

.video-more {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.video-more-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* ---------- CTA ---------- */
.cta-band {
  padding: 56px 0;
  background: linear-gradient(120deg, #084d5c, #0b7285 55%, #0e93a9);
  color: #fff;
}

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cta-band h2 {
  font-size: clamp(24px, 3vw, 32px);
}

.cta-band p {
  max-width: 56ch;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-band .btn-primary {
  background: #fff;
  color: var(--brand-700);
  box-shadow: none;
}

.cta-band .btn-primary:hover {
  background: #eaf6f9;
}

.cta-band .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.cta-band .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 56px 0 0;
  background: #072f39;
  color: rgba(255, 255, 255, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 44px;
}

.footer-brand .logo-text strong {
  color: #fff;
}

.footer-brand .logo-text small {
  color: rgba(255, 255, 255, 0.55);
}

.footer-brand p {
  max-width: 34ch;
  margin-top: 16px;
  font-size: 14px;
}

.site-footer h4 {
  margin-bottom: 16px;
  color: #fff;
  font-size: 14.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer ul {
  display: grid;
  gap: 10px;
  font-size: 14px;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.contact-list .contact-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 2px;
  fill: currentColor;
}

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}

.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Trang trong ---------- */
.page {
  padding: 28px 0 80px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb .current {
  color: var(--ink);
  font-weight: 500;
}

.page-head {
  margin-bottom: 26px;
}

.page-head h1 {
  font-size: clamp(26px, 3vw, 34px);
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

/* ---------- Chi tiết sản phẩm ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 48px;
  align-items: start;
  max-width: 1080px;
}

/* Cho phép các cột co lại, tránh tràn ngang khi dải thumbnail dài */
.detail-grid > * {
  min-width: 0;
}

/* Ảnh chính cuộn đi cùng trang (không dùng sticky): nếu ghim, ảnh sẽ nằm
   trên các ảnh của tab "Mô tả chi tiết" bên dưới. */
.detail-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

/* Ảnh chính của trang chi tiết (ảnh đại diện + ảnh thật khi bấm thumbnail):
   khung vuông, nền trắng, contain để ảnh dọc/ảnh ngang đều không bị cắt. */
.detail-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.badge-inline {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.detail-cat {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.detail-info h1 {
  margin: 8px 0 14px;
  font-size: clamp(24px, 3vw, 34px);
}

.detail-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-price .price {
  font-size: 30px;
}

.detail-price .price--contact {
  font-size: 22px;
}

.detail-price .price-old {
  font-size: 16px;
}

.discount {
  padding: 3px 9px;
  border-radius: 6px;
  background: #fdeaea;
  color: #c92a2a;
  font-size: 12.5px;
  font-weight: 700;
}

.detail-short {
  margin: 16px 0 18px;
  font-size: 15.5px;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 9px;
  margin-bottom: 26px;
}

.feature-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.55;
}

.buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.qty-stepper button {
  width: 42px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 18px;
  display: grid;
  place-items: center;
}

.qty-stepper button:hover {
  background: var(--brand-soft);
}

.qty-stepper input {
  width: 46px;
  height: 44px;
  border: 0;
  text-align: center;
  font: inherit;
  font-weight: 600;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-stepper--sm button {
  width: 34px;
  height: 36px;
  font-size: 16px;
}

.qty-stepper--sm input {
  width: 38px;
  height: 36px;
  font-size: 14px;
}

.policy-list {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--brand-softer);
  color: #3c606b;
  font-size: 13.5px;
}

.policy-list li {
  display: flex;
  gap: 9px;
}

.policy-list strong {
  color: var(--ink);
}

.detail-extra {
  max-width: 1080px;
  margin-top: 52px;
}

.detail-extra h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.detail-extra .prose {
  margin-bottom: 34px;
  color: var(--muted);
}

/* description soạn bằng HTML (p / ul / li / strong) trong js/data.js */
.detail-extra .prose p {
  margin-bottom: 14px;
  line-height: 1.75;
}

.detail-extra .prose p:last-child,
.detail-extra .prose ul:last-child {
  margin-bottom: 0;
}

.detail-extra .prose ul {
  margin: 0 0 16px;
  padding-left: 20px;
  list-style: disc;
}

.detail-extra .prose li {
  margin-bottom: 9px;
  line-height: 1.7;
}

.detail-extra .prose li:last-child {
  margin-bottom: 0;
}

.detail-extra .prose li::marker {
  color: var(--brand);
}

.detail-extra .prose strong {
  color: var(--ink);
}

.spec-table {
  width: 100%;
  margin-bottom: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: 14px;
  background: #fff;
  font-size: 14.5px;
}

.spec-table tr:nth-child(odd) {
  background: #fafdfe;
}

.spec-table th,
.spec-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

.spec-table th {
  width: 34%;
  color: #3c606b;
  font-weight: 600;
}

/* Video review trong trang chi tiết sản phẩm: chỉ 1 thẻ nên giới hạn bề ngang
   để khung 16:9 không cao quá khổ trên màn hình rộng */
.detail-video {
  margin-top: 48px;
}

.detail-video .video-grid {
  grid-template-columns: minmax(0, 560px);
}

.related {
  margin-top: 56px;
}

.related h2 {
  margin-bottom: 18px;
  font-size: 22px;
}

/* ---------- Thư viện ảnh trang chi tiết (tab thực tế / mô tả) ---------- */
.media-gallery {
  grid-column: 1 / -1;
  margin-top: 40px;
}

.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.media-tab {
  padding: 10px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.media-tab:hover {
  border-color: #9fcbd6;
  color: var(--brand);
}

.media-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.media-tab:focus-visible {
  outline: 3px solid rgba(11, 114, 133, 0.3);
  outline-offset: 2px;
}

.media-panel {
  padding-top: 18px;
}

.gallery-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

/* Dải thumbnail của tab "Hình ảnh thực tế": khung vuông, nền trắng,
   ảnh contain để thấy đủ ảnh (ảnh chụp thực tế thường là ảnh dọc). */
.gallery-thumb {
  flex: 0 0 auto;
  width: 108px;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.gallery-thumb:hover {
  border-color: #9fcbd6;
  transform: translateY(-2px);
}

.gallery-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.gallery-stack {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.gallery-figure {
  width: 100%;
  max-width: 860px;
  margin: 0;
}

.gallery-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.media-empty {
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--brand-softer);
  color: var(--muted);
  font-size: 14px;
}

.not-found {
  padding: 64px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.not-found h1 {
  margin-bottom: 10px;
}

.not-found p {
  margin-bottom: 22px;
  color: var(--muted);
}

/* ---------- Trang 404 ---------- */
.error-page {
  margin-bottom: 56px;
  padding: 72px 24px 64px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.error-page .error-code {
  margin: 0 0 10px;
  font-size: clamp(64px, 12vw, 112px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--brand);
  background: linear-gradient(135deg, #0b7285, #0e9bb3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-page h1 {
  margin-bottom: 12px;
}

.error-page p {
  max-width: 620px;
  margin: 0 auto 24px;
  color: var(--muted);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px dashed var(--line);
  list-style: none;
  font-size: 14px;
}

.error-links a {
  color: var(--brand);
  font-weight: 600;
}

.error-links a:hover {
  text-decoration: underline;
}

/* ---------- Giỏ hàng ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.cart-main {
  min-width: 0;
}

.cart-list {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.cart-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cart-thumb {
  display: block;
  width: 112px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--brand-softer);
}

.cart-thumb img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cart-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cart-name {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
}

.cart-name:hover {
  color: var(--brand);
}

.cart-unit {
  font-size: 13px;
  color: var(--muted);
}

.link-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: #c92a2a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: #a51e1e;
}

.cart-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-line-total {
  font-size: 16px;
  font-weight: 700;
  color: #d9480f;
}

.cart-summary {
  position: sticky;
  top: 96px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.cart-summary h2 {
  margin-bottom: 16px;
  font-size: 19px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 14.5px;
  color: var(--muted);
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--ink);
}

.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-weight: 600;
}

.summary-total strong {
  font-size: 24px;
  font-weight: 800;
  color: #d9480f;
}

.summary-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

.empty-state {
  padding: 64px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.empty-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.empty-icon svg {
  width: 34px;
  height: 34px;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

.empty-state p {
  margin-bottom: 22px;
  color: var(--muted);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 20px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 32, 40, 0.55);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(4, 26, 33, 0.35);
  animation: popIn 0.22s ease;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f7f9;
  color: #3c606b;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.modal-close:hover {
  background: #e3eef2;
}

.modal-card h2 {
  font-size: 22px;
}

.modal-sub {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 13.5px;
  font-weight: 600;
}

.form-field label span {
  color: #c92a2a;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fbfdfe;
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.12);
}

.form-field textarea {
  min-height: 74px;
  resize: vertical;
}

.field-error {
  font-size: 12.5px;
  color: #c92a2a;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #e8595c;
  background: #fff7f7;
}

.modal-card .btn-block {
  margin-top: 8px;
}

/* ---------- Modal Bộ lọc (kiểu Điện Máy Xanh) ---------- */
.filter-modal {
  z-index: 90;
}

.filter-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 680px);
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.filter-head h2 {
  font-size: 19px;
  line-height: 1.3;
}

.filter-close {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-close:hover {
  border-color: var(--brand);
  background: var(--brand-softer);
}

.filter-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.16);
}

.filter-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px 8px;
  overscroll-behavior: contain;
}

.filter-group + .filter-group {
  margin-top: 22px;
}

.filter-heading {
  margin-bottom: 12px;
  font-size: 14.5px;
  font-weight: 700;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Nút lọc: viền mỏng, bo nhẹ; active = nền xanh nhạt + viền xanh */
.filter-chip {
  padding: 9px 16px;
  border: 1px solid #dbe6eb;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  line-height: 1.4;
  color: #33525c;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--brand);
  color: var(--brand-700);
}

.filter-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.16);
}

.filter-chip.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 600;
}

/* ---------- Thanh trượt khoảng giá ---------- */
.filter-range {
  margin-top: 24px;
}

.filter-slider {
  margin: 0 12px;
}

/* Ghi đè màu mặc định của noUiSlider cho hợp tông website */
.filter-slider.noUi-target {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #e5eef2;
  box-shadow: none;
}

.filter-slider .noUi-connects {
  border-radius: 999px;
}

.filter-slider .noUi-connect {
  background: var(--brand);
}

.filter-slider .noUi-handle {
  width: 24px;
  height: 24px;
  top: -9px;
  right: -12px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(8, 52, 64, 0.22);
  cursor: grab;
}

.filter-slider .noUi-handle:active {
  cursor: grabbing;
}

.filter-slider .noUi-handle::before,
.filter-slider .noUi-handle::after {
  display: none;
}

.filter-slider .noUi-handle:focus-visible,
.filter-slider .noUi-handle.noUi-active {
  outline: none;
  box-shadow: 0 0 0 4px rgba(11, 114, 133, 0.18);
}

.filter-range-value {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-700);
}

/* Fallback 2 input range khi không tải được noUiSlider */
.filter-fallback {
  display: grid;
  gap: 10px;
}

.filter-fallback input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

.filter-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.filter-summary {
  margin: 24px 0 4px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}

.filter-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.filter-foot .btn {
  height: 46px;
}

.filter-foot .btn-primary {
  flex: 1 1 auto;
}

.filter-foot .btn-ghost {
  flex: 0 0 auto;
}

/* ---------- Modal chọn sản phẩm (builder) ---------- */
.picker-modal {
  z-index: 95;
}

.picker-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 1040px);
  height: min(88vh, 860px);
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
}

.picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.picker-head h2 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.25;
}

.picker-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.picker-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2f7f9;
  color: #3c606b;
  font-size: 20px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.picker-close:hover {
  background: #e3eef2;
  color: var(--brand);
}

.picker-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.16);
}

.picker-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfe;
}

.picker-search > svg {
  position: absolute;
  left: 38px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.picker-search input {
  width: 100%;
  padding: 11px 44px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.picker-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.12);
}

.picker-search input::-webkit-search-cancel-button {
  display: none;
}

.picker-search-clear {
  position: absolute;
  right: 34px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e9f2f5;
  color: #3c606b;
  font-size: 16px;
  line-height: 1;
}

.picker-search-clear:hover {
  background: #d7e8ee;
  color: var(--brand);
}

.picker-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 24px 24px;
  overscroll-behavior: contain;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.picker-item {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.picker-item:hover {
  border-color: #c8dfe6;
  box-shadow: 0 10px 22px rgba(11, 114, 133, 0.08);
  transform: translateY(-1px);
}

.picker-item.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(11, 114, 133, 0.12);
}

.picker-item[hidden] {
  display: none;
}

.picker-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #f6fafb;
}

.picker-thumb img {
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}

.picker-brand {
  margin-top: 10px;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.picker-name {
  display: -webkit-box;
  min-height: 2.8em;
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.picker-sku {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.picker-price {
  margin: 8px 0 0;
  color: #0b7285;
  font-size: 14.5px;
  font-weight: 800;
}

.picker-item .btn {
  width: 100%;
  margin-top: 10px;
}

.picker-empty {
  padding: 40px 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.picker-count {
  color: var(--muted);
  font-size: 13px;
}

.picker-foot .btn {
  min-width: 110px;
}

@keyframes sheetUp {
  from {
    transform: translateY(26px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.success-view {
  padding: 10px 0;
  text-align: center;
}

.success-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e7f7ef;
  color: #0f8a5f;
  font-size: 30px;
  display: grid;
  place-items: center;
}

.success-view p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(370px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #0c2f39;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 16px 32px rgba(4, 26, 33, 0.3);
  animation: popIn 0.2s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

.toast-text {
  flex: 1;
  line-height: 1.45;
}

.toast-link {
  color: #8fe3f2;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.toast-link:hover {
  text-decoration: underline;
}

/* ---------- Trang "Xây dựng phòng tắm" ---------- */
.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}

.builder-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.builder-panel-head,
.builder-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.builder-panel-head h2,
.builder-summary-head h2 {
  margin-top: 4px;
  font-size: 20px;
}

.builder-step {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.builder-slots {
  display: grid;
  gap: 12px;
}

.builder-loading {
  color: var(--muted);
  font-size: 14px;
}

.builder-slot {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--brand-softer);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.builder-slot.is-filled {
  border-color: rgba(11, 114, 133, 0.45);
  background: #fff;
  box-shadow: 0 10px 24px rgba(11, 114, 133, 0.1);
}

.slot-thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--brand);
}

.slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-index {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(11, 114, 133, 0.55);
}

.slot-body {
  min-width: 0;
}

.slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 9px;
}

.slot-name {
  font-size: 15.5px;
  font-weight: 700;
}

.slot-meta {
  font-size: 12px;
  color: var(--muted);
}

.slot-controls {
  display: flex;
  gap: 8px;
}

/* Nút mở modal chọn sản phẩm (thay cho <select>) */
.slot-picker {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.slot-picker:hover {
  border-color: #c8dfe6;
}

.slot-picker:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.15);
}

.slot-picker.is-filled {
  border-color: rgba(11, 114, 133, 0.35);
  background: #fbffff;
}

.slot-picker-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slot-picker-text strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.slot-picker-text small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.slot-picker-action {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
}

.slot-picker.is-filled .slot-picker-action {
  color: var(--muted);
}

.slot-clear {
  flex-shrink: 0;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.slot-clear:hover {
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #c92a2a;
}

.builder-summary {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.builder-count {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.builder-picked {
  display: grid;
  gap: 10px;
}

.builder-picked:not(:empty) {
  margin-bottom: 14px;
}

.picked-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  animation: pickedIn 0.2s ease;
}

@keyframes pickedIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.picked-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--brand-softer);
}

.picked-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.picked-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.picked-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.picked-name:hover {
  color: var(--brand);
}

/* Cụm số lượng + thành tiền trong “Cấu hình hiện tại” */
.picked-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.picked-qty {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.picked-qty-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: #f7fbfc;
  color: var(--brand);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.picked-qty-btn:hover:not(:disabled) {
  background: var(--brand-soft);
  color: var(--brand-700);
}

.picked-qty-btn:disabled {
  color: #b9c8cd;
  cursor: not-allowed;
}

.picked-qty-value {
  min-width: 32px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.picked-price {
  font-size: 13.5px;
  font-weight: 700;
  color: #d9480f;
}

.picked-unit {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.summary-deposit {
  margin-top: 2px;
  padding-top: 0;
  color: #b02a0c;
  font-size: 13.5px;
}

.summary-deposit span:last-child {
  color: #b02a0c;
  font-weight: 800;
}

.picked-price.is-contact {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
}

.picked-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.picked-remove:hover {
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #c92a2a;
}

.builder-empty {
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--brand-softer);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  text-align: center;
}

.builder-total {
  margin-top: 14px;
}

.summary-total strong.is-contact {
  font-size: 17px;
  color: var(--brand);
}

.builder-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.builder-actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Cấu hình đã lưu */
.builder-saved {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.builder-saved h2 {
  font-size: 20px;
}

.builder-saved-sub {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 13.5px;
}

.saved-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.saved-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.saved-name {
  font-size: 15px;
  font-weight: 700;
}

.saved-meta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.saved-names {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.saved-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.saved-total {
  font-size: 16px;
  font-weight: 800;
  color: #d9480f;
}

.saved-actions {
  display: flex;
  gap: 8px;
}

.saved-actions .btn.is-confirming {
  border-color: #ffc9c9;
  background: #ffe3e3;
  color: #c92a2a;
}

/* Đầu khu "Cấu hình đã lưu" */
.builder-saved-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.builder-saved-head .builder-saved-sub {
  margin: 6px 0 0;
}

.builder-saved-count {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e6f3f6;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.saved-date {
  color: #7a9098;
  font-size: 12.5px;
}

.saved-warn {
  color: #c05621;
  font-size: 12.5px;
  font-weight: 600;
}

.saved-empty {
  padding: 22px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfe;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.builder-saved.is-flash {
  animation: savedFlash 1.4s ease;
}

@keyframes savedFlash {
  0% {
    background: transparent;
  }
  25% {
    background: #eaf7fa;
  }
  100% {
    background: transparent;
  }
}

/* Tóm tắt cấu hình trong hộp thoại lưu */
.save-config-summary {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f8fa;
  color: #3c606b;
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- Bước 3: thông tin khách hàng + khung báo giá ---------- */
.builder-contact {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.builder-contact h2,
.quote-export-head h2 {
  margin-top: 4px;
  font-size: 20px;
}

.builder-contact-sub,
.quote-export-sub {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.quote-export-sub {
  margin-bottom: 0;
}

.builder-contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.builder-contact-form .form-field:nth-child(3) {
  grid-column: 1 / -1;
}

.builder-contact-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.builder-contact-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.quote-export {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  animation: quoteIn 0.28s ease;
}

@keyframes quoteIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.quote-export-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

/* Khung cuộn ngang: tờ báo giá giữ nguyên khổ 720px trên mobile */
.quote-frame {
  overflow-x: auto;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #eef5f7;
}

.quote-frame-hint {
  display: none;
}

@media (max-width: 900px) {
  .quote-frame-hint {
    display: block;
    margin: 0 0 8px;
    color: #5f7a83;
    font-size: 12px;
    text-align: center;
  }
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quote-actions .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

/* Ghi chú khi trình duyệt chặn ảnh cục bộ (mở builder.html bằng file://) */
.quote-media-note {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff8ed;
  color: #a15c11;
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- Tờ báo giá (cũng là vùng html2canvas chụp) ----------
   Chỉ dùng layout block + <table> (không grid/flex) để ảnh xuất ra
   khớp với bản xem trước trên mọi trình duyệt. */
.quote {
  width: 720px;
  margin: 0 auto;
  padding: 30px 32px 24px;
  border-top: 6px solid #0b7285;
  background: #fff;
  color: #103039;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 26px rgba(8, 52, 64, 0.12);
}

.quote-head {
  padding-bottom: 14px;
  border-bottom: 2px solid #0b7285;
  text-align: center;
}

.quote-mark {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 12px;
  object-fit: cover;
}

.quote-company {
  margin: 0;
  color: #084d5c;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.quote-slogan {
  margin: 2px 0 8px;
  color: #5f7a83;
  font-size: 12px;
}

.quote-line {
  margin: 1px 0;
  color: #38555e;
  font-size: 12.5px;
}

.quote-title {
  margin: 18px 0 0;
  color: #103039;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.quote-code {
  margin: 4px 0 14px;
  color: #5f7a83;
  font-size: 12px;
  text-align: center;
}

.quote-customer {
  width: 100%;
  margin-bottom: 16px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.quote-customer th,
.quote-customer td {
  padding: 6px 10px;
  border: 1px solid #e0ebef;
  text-align: left;
  vertical-align: top;
}

.quote-customer th {
  width: 15%;
  background: #f3fafc;
  color: #38555e;
  font-weight: 700;
  white-space: nowrap;
}

.quote-customer td {
  color: #103039;
  font-weight: 600;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.quote-table th,
.quote-table td {
  padding: 8px 10px;
  border: 1px solid #dfe9ec;
  text-align: left;
  vertical-align: top;
}

.quote-table thead th {
  border-color: #0b7285;
  background: #0b7285;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.quote-table tbody tr:nth-child(even) {
  background: #f7fafb;
}

.quote-index {
  width: 30px;
  color: #5f7a83;
  text-align: center;
}

/* Cột ảnh sản phẩm: khung 60 × 60 cố định, object-fit: contain để ảnh không méo */
.quote-photo {
  width: 78px;
  text-align: center;
}

.quote-table td.quote-photo {
  padding: 6px 8px;
  vertical-align: middle;
}

.quote-item-photo {
  display: block;
  width: 60px;
  height: 60px;
  min-width: 60px;
  max-width: none; /* bỏ max-width: 100% toàn cục để ảnh luôn đúng 60 × 60 */
  margin: 0 auto;
  border: 1px solid #eef3f5;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

/* Ảnh lỗi / không tải được ⇒ hiện ô chữ thay vì biểu tượng ảnh hỏng */
.quote-photo-fallback {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border: 1px dashed #cfe0e5;
  border-radius: 6px;
  color: #8fa8b0;
  font-size: 11px;
  font-weight: 700;
  line-height: 60px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Khi trình duyệt chặn ảnh cục bộ (mở bằng file://) mà vẫn phải chụp ảnh báo giá:
   ẩn hẳn cột Ảnh để html2canvas không tạo canvas bị “nhiễm” (tainted). */
.quote.quote--no-photo .quote-photo {
  display: none;
}

.quote-qty {
  width: 40px;
  font-weight: 700;
  text-align: center;
}

/* Cột “Phân loại”: badge nhẹ – Jomoo VN màu xanh, hàng nội địa màu cam/đỏ */
.quote-kind {
  width: 80px;
  text-align: center;
}

.quote-table td.quote-kind {
  padding: 8px 6px;
  vertical-align: middle;
}

.quote-kind-badge {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.quote-kind-badge--vn {
  border-color: #bfe6cd;
  background: #e6f6ec;
  color: #0b7a3b;
}

.quote-kind-badge--domestic {
  border-color: #f6c9b6;
  background: #ffe9e0;
  color: #b02a0c;
}

.quote-price,
.quote-amount {
  width: 108px;
  text-align: right;
  white-space: nowrap;
}

.quote-amount {
  color: #d9480f;
  font-weight: 700;
}

.quote-item-name {
  display: block;
  font-weight: 600;
}

.quote-item-cat {
  display: block;
  margin-top: 2px;
  color: #7a9098;
  font-size: 11px;
}

.quote-table tfoot th,
.quote-table tfoot td {
  padding: 10px;
  border-color: #cfe6ec;
  background: #e8f5f8;
  font-size: 13.5px;
  font-weight: 800;
}

.quote-table tfoot th {
  text-align: right;
  letter-spacing: 0.02em;
}

.quote-table tfoot td {
  color: #d9480f;
  text-align: right;
  white-space: nowrap;
}

/* Hàng “Tiền cọc (70% hàng nội địa)”: nền cam nhạt, chữ đỏ đậm để khách thấy ngay */
.quote-table tfoot tr.quote-deposit th,
.quote-table tfoot tr.quote-deposit td {
  border-color: #f6c9b6;
  background: #ffe9e0;
  color: #b02a0c;
}

.quote-table tfoot tr.quote-deposit td {
  font-size: 14px;
  font-weight: 800;
}

/* Ghi chú chính sách đặt cọc: nằm sát dưới bảng, in nghiêng, viền trái nhấn màu */
.quote-deposit-note {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-left: 3px solid #f08c5a;
  border-radius: 0 8px 8px 0;
  background: #fff1e8;
  color: #b02a0c;
  font-size: 11.5px;
  font-style: italic;
  line-height: 1.5;
}

.quote-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8ed;
  color: #a15c11;
  font-size: 12px;
}

.quote-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed #dfe9ec;
  color: #5f7a83;
  font-size: 11.5px;
  text-align: center;
}

.quote-foot p + p {
  margin-top: 3px;
}

@media (max-width: 620px) {
  .builder-contact,
  .quote-export {
    padding: 16px;
  }

  .builder-contact-form {
    grid-template-columns: 1fr;
  }

  .builder-contact-form .form-field:nth-child(3),
  .builder-contact-actions {
    grid-column: auto;
  }

  .quote-frame {
    padding: 10px;
  }

  .quote {
    padding: 20px 16px;
  }

  .quote-actions .btn {
    flex: 1 1 100%;
  }
}

/* Header có thêm mục "Xây dựng phòng tắm" ⇒ thu gọn nav ở màn hình vừa */
@media (max-width: 1080px) {
  .main-nav {
    gap: 18px;
  }

  .main-nav a {
    font-size: 14.5px;
  }

  .hotline-label {
    display: none;
  }
}

@media (max-width: 1024px) {
  .builder-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 22px;
  }

  .builder-panel,
  .builder-summary {
    padding: 20px;
  }
}

@media (max-width: 900px) {
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .builder-summary {
    position: static;
  }
}

@media (max-width: 620px) {
  .builder-panel,
  .builder-summary {
    padding: 16px;
  }

  .builder-slot {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .slot-thumb {
    width: 48px;
    height: 48px;
  }

  .slot-index {
    font-size: 15px;
  }

  .slot-controls {
    flex-wrap: wrap;
  }

  .slot-clear {
    padding: 8px 14px;
  }

  .picked-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 9px;
  }

  .picked-thumb {
    width: 48px;
    height: 48px;
  }

  .picked-qty-btn {
    width: 32px;
    height: 32px;
  }

  .picked-qty-value {
    min-width: 34px;
    font-size: 13px;
  }

  .saved-list {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero-grid {
    gap: 36px;
    padding: 56px 0 64px;
  }

  /* Banner + sidebar danh mục thu gọn khoảng cách */
  .catalog-banner {
    gap: 26px;
    padding: 28px 30px;
  }

  .catalog-layout {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 24px;
  }

  .about-grid {
    gap: 36px;
  }

  .detail-grid {
    gap: 32px;
  }

  .cart-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
  }

  .footer-grid {
    gap: 28px;
  }
}

@media (max-width: 900px) {
  section[id] {
    scroll-margin-top: 138px;
  }

  /* Trang danh mục: banner xếp dọc, sidebar thành dải danh mục cuộn ngang */
  .catalog-banner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px 24px;
  }

  .catalog-banner-media {
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 28px;
  }

  .catalog-sidebar {
    position: static;
    gap: 0;
  }

  .sidebar-card {
    padding: 14px 12px;
  }

  .sidebar-title {
    margin-bottom: 10px;
  }

  .cat-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .cat-nav::-webkit-scrollbar {
    display: none;
  }

  .cat-link {
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13.5px;
    white-space: nowrap;
  }

  .cat-link::after {
    display: none;
  }

  .cat-link.is-active {
    border-color: var(--brand);
  }

  /* Thẻ tư vấn đã có sẵn ở cta-band cuối trang chủ/trang danh mục */
  .sidebar-promo {
    display: none;
  }

  .catalog-main {
    scroll-margin-top: 150px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 20px;
    padding-top: 9px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  .header-actions {
    margin-left: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 56px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .hero-media {
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
  }

  .hero-stats {
    margin-top: 30px;
    gap: 28px;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .section {
    padding: 54px 0;
  }

  .video-grid {
    gap: 20px;
  }

  .video-more {
    margin-top: 28px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-cards {
    max-width: 560px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .detail-media {
    max-width: 620px;
  }

  .detail-info {
    order: 2;
  }

  .media-gallery {
    order: 1;
    margin-top: 4px;
  }

  .detail-extra {
    margin-top: 40px;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .site-footer {
    padding-top: 44px;
  }
}

@media (max-width: 620px) {
  .container {
    width: calc(100% - 28px);
  }

  .media-tab {
    padding: 9px 16px;
    font-size: 13.5px;
  }

  .gallery-thumb {
    width: 92px;
  }

  .gallery-stack {
    gap: 12px;
  }

  .product-toolbar {
    gap: 10px;
  }

  .search-field {
    flex-basis: 100%;
    max-width: none;
  }

  .search-field input {
    font-size: 16px;
  }

  /* Sắp xếp + Bộ lọc nằm chung hàng dưới ô tìm kiếm */
  .sort-field {
    flex: 1 1 150px;
    width: auto;
    margin-left: 0;
    justify-content: flex-start;
  }

  .sort-field select {
    flex: 1;
    min-width: 0;
  }

  .filter-toggle {
    flex: 0 0 auto;
    padding: 0 14px;
  }

  /* Modal bộ lọc: dạng bottom sheet trên mobile */
  .filter-modal {
    place-items: end center;
    padding: 0;
  }

  .filter-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    animation: sheetUp 0.24s ease;
  }

  .filter-head {
    padding: 16px 16px 14px;
  }

  .filter-body {
    padding: 16px 16px 4px;
  }

  .filter-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .filter-foot .btn {
    height: 44px;
  }

  .logo-text strong {
    font-size: 18px;
  }

  .cart-link {
    padding: 9px 13px;
    font-size: 13.5px;
  }

  .cart-label {
    display: none;
  }

  .hotline-link {
    padding: 9px 11px;
  }

  .hotline-label {
    display: none;
  }

  .hero h1 {
    font-size: clamp(30px, 8vw, 40px);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .hero-media::before {
    inset: 16px -12px -12px 16px;
    filter: blur(14px);
  }

  .hero-tag {
    left: 14px;
    bottom: 14px;
    padding: 10px 14px;
  }

  .hero-tag strong {
    font-size: 15px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .hero-stats span {
    font-size: 12px;
  }

  .hero-stats strong {
    font-size: 19px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section {
    padding: 44px 0;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 20px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .video-play {
    width: 52px;
    height: 52px;
  }

  .video-play svg {
    width: 20px;
    height: 20px;
  }

  .video-title {
    /* 1 cột nên không cần giữ 2 dòng cho thẳng hàng */
    min-height: 0;
    font-size: 15px;
  }

  .video-more {
    margin-top: 26px;
  }

  .video-more .btn {
    width: 100%;
  }

  .catalog-banner {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .catalog-banner h1 {
    font-size: 24px;
  }

  .catalog-banner-copy p {
    font-size: 14px;
  }

  .catalog-banner-tags {
    margin-top: 16px;
  }

  .catalog-banner-tags li {
    padding: 6px 12px;
    font-size: 12px;
  }

  .sidebar-card {
    padding: 12px 10px;
  }

  .cat-link {
    padding: 8px 11px;
    font-size: 13px;
  }

  .catalog-head {
    margin-bottom: 14px;
  }

  .catalog-head h2 {
    font-size: 21px;
  }

  .catalog-head p {
    font-size: 13.5px;
  }

  .featured-more {
    margin-top: 26px;
  }

  .featured-more .btn {
    width: 100%;
    padding: 14px 20px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    gap: 6px;
    padding: 12px 12px 14px;
  }

  .card-name {
    font-size: 14px;
  }

  .price {
    font-size: 16px;
  }

  .price-old {
    font-size: 12px;
  }

  .badge {
    top: 9px;
    left: 9px;
    padding: 4px 9px;
    font-size: 10px;
  }

  .badge--sale {
    left: auto;
    right: 9px;
  }

  .card-actions {
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }

  .card-actions .btn {
    padding: 9px 10px;
    font-size: 12.5px;
  }

  .about-cards {
    gap: 12px;
  }

  .about-card {
    padding: 20px 16px;
  }

  .about-card strong {
    font-size: 22px;
  }

  .cta-band {
    padding: 40px 0;
  }

  .site-footer {
    padding-top: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-bottom: 30px;
  }

  .page {
    padding: 20px 0 56px;
  }

  .detail-price .price {
    font-size: 26px;
  }

  .buy-row .btn {
    flex: 1;
  }

  .spec-table th {
    width: 42%;
  }

  .spec-table th,
  .spec-table td {
    padding: 10px 12px;
  }

  .cart-item {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .cart-thumb {
    width: 84px;
  }

  .cart-qty {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cart-line-total {
    font-size: 15px;
  }

  .modal-card {
    padding: 24px 20px;
  }

  .toast-wrap {
    right: 14px;
    left: 14px;
    bottom: 14px;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 14px 22px;
  }
}

/* ============================================================
   Sidebar danh mục: menu cha – con (Hàng Nội Địa / Hàng Jomoo VN)
   Cấp 1 in đậm + mũi tên chỉ xuống, cấp 2 thụt lề và chữ nhỏ hơn.
   Danh sách con trượt xuống bằng max-height (JS js/catalog.js gán
   đúng chiều cao thật nên không bị giật hay cắt chữ).
   ============================================================ */

/* Nút mục cha: in đậm, màu đậm hơn mục con để phân cấp rõ ràng */
.cat-link.cat-parent {
  color: var(--ink);
  font-weight: 700;
}

.cat-link.cat-parent .cat-count {
  background: var(--brand-soft);
  color: var(--brand-700);
}

/* Mũi tên chỉ xuống cho mục cha có danh sách con */
.cat-link.cat-parent:not(.cat-parent--leaf)::after {
  margin-top: -4px;
  transform: rotate(45deg);
  opacity: 0.55;
  transition: transform 0.25s ease, margin-top 0.25s ease, opacity 0.18s ease;
}

/* Đang mở: mũi tên quay lên, mục cha sáng nhẹ */
.cat-group.is-open > .cat-link.cat-parent::after {
  margin-top: 2px;
  transform: rotate(-135deg);
  opacity: 0.9;
}

.cat-group.is-open > .cat-link.cat-parent,
.cat-group.has-active > .cat-link.cat-parent {
  background: var(--brand-softer);
  color: var(--brand-700);
}

/* Danh sách con: trượt xuống mượt, đóng lại thì ẩn hẳn khỏi bàn phím */
.cat-sub {
  display: grid;
  gap: 2px;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transition: max-height 0.3s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.22s ease, visibility 0s linear 0.3s;
}

.cat-group.is-open > .cat-sub {
  opacity: 1;
  visibility: visible;
  transition: max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.26s ease 0.04s, visibility 0s linear 0s;
}

/* Đường kẻ dọc nối các mục con với mục cha */
.cat-sub > li {
  position: relative;
}

.cat-sub > li::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 17px;
  width: 1px;
  background: var(--line);
}

/* Mục con: thụt lề vào trong, chữ nhỏ hơn, không dùng mũi tên */
.cat-link.cat-child {
  padding: 8px 10px 8px 28px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}

.cat-link.cat-child::after {
  display: none;
}

.cat-link.cat-child .cat-count {
  min-width: 26px;
  padding: 1px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.cat-link.cat-child:hover,
.cat-link.cat-child:focus-visible {
  background: var(--brand-softer);
  color: var(--brand-700);
}

.cat-link.cat-child.is-active {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 700;
}

.cat-link.cat-child.is-active .cat-count {
  background: var(--brand);
  color: #fff;
}

/* Mobile / tablet: bỏ dải danh mục cuộn ngang cũ, dùng danh sách dọc
   để accordion sổ xuống đúng chỗ; vùng chạm cao hơn cho ngón tay. */
@media (max-width: 900px) {
  .cat-nav {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .cat-link {
    white-space: normal;
  }

  .cat-link.cat-parent {
    min-height: 44px;
  }

  /* Vẫn hiện mũi tên chỉ xuống để biết mục nào bấm mở được */
  .cat-link.cat-parent:not(.cat-parent--leaf)::after {
    display: block;
    width: 8px;
    height: 8px;
    margin-top: -5px;
  }

  .cat-group.is-open > .cat-link.cat-parent::after {
    margin-top: 2px;
  }

  .cat-link.cat-child {
    padding: 10px 10px 10px 30px;
    font-size: 13px;
  }
}

@media (max-width: 620px) {
  .slot-picker {
    flex-basis: 100%;
    font-size: 15px;
  }

  /* Modal chọn sản phẩm: bottom sheet trên mobile */
  .picker-modal {
    place-items: end center;
    padding: 0;
  }

  .picker-card {
    width: 100%;
    height: 92vh;
    max-height: 92vh;
    padding: 0;
    border-radius: 20px 20px 0 0;
    animation: sheetUp 0.24s ease;
  }

  .picker-head {
    padding: 16px 16px 12px;
  }

  .picker-head h2 {
    font-size: 19px;
  }

  .picker-search {
    padding: 12px 16px;
  }

  .picker-search input {
    font-size: 16px; /* tránh iOS tự phóng to khi focus */
  }

  .picker-search > svg {
    left: 30px;
  }

  .picker-search-clear {
    right: 26px;
  }

  .picker-body {
    padding: 14px 16px 18px;
  }

  .picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .picker-item {
    padding: 8px;
    border-radius: 13px;
  }

  .picker-brand {
    margin-top: 8px;
    font-size: 9.5px;
  }

  .picker-name {
    font-size: 13px;
  }

  .picker-price {
    font-size: 13.5px;
  }

  .picker-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

