/* SSC Shop - giao diện trang khách hàng. Màu chủ đạo --primary lấy từ Cài đặt > Chung */
:root {
  --primary: #e4572e;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f6f8;
  --card: #fff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --container: 1240px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.tc { text-align: center; }
.tr { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.show-sm { display: none; }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-weight: 600; transition: .15s; background: #fff; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(.92); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .88rem; }
.btn-lg { padding: 12px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; }

/* Topbar + header */
.topbar { background: var(--primary); color: #fff; font-size: .85rem; line-height: 22px; }
.topbar-inner { display: flex; justify-content: space-between; gap: 12px; padding: 6px 16px; }
.topbar a { color: #fff; margin-left: 14px; }
/* Header dính: mọi chiều cao trong header phải là số nguyên px, lẻ (vd 23,25px) là logo/ô tìm kiếm rung khi cuộn */
.site-header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; line-height: 22px; }
.has-admin-bar .site-header { top: 32px; }
.header-main { display: flex; align-items: center; gap: 24px; padding: 12px 16px; }
.logo img { max-height: 44px; width: auto; }
.logo-text { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -.5px; }
.search-wrap { flex: 1; max-width: 560px; position: relative; }
.search-wrap .search-form { max-width: none; }
.search-form { flex: 1; display: flex; border: 2px solid var(--primary); border-radius: 999px; overflow: hidden; background: #fff; max-width: 560px; }
.search-form input { flex: 1; border: 0; padding: 10px 16px; line-height: 22px; outline: none; min-width: 0; }
.search-form button { border: 0; background: var(--primary); color: #fff; padding: 0 18px; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.header-hotline { display: flex; align-items: center; gap: 8px; color: var(--primary); }
.header-hotline span { display: flex; flex-direction: column; line-height: 18px; }
.header-hotline small { color: var(--muted); font-size: .75rem; line-height: 16px; }
.header-icon { display: flex; align-items: center; gap: 6px; position: relative; font-size: .9rem; }
.cart-count { position: absolute; top: -8px; left: 14px; background: var(--primary); color: #fff; font-size: .7rem; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; padding: 0 4px; font-weight: 700; }
.nav-toggle { display: none; background: none; border: 0; width: 36px; height: 36px; padding: 6px; cursor: pointer; flex-direction: column; justify-content: space-around; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.main-nav { border-top: 1px solid var(--border); }
.nav-inner { display: flex; align-items: stretch; gap: 8px; }
.nav-categories { position: relative; }
.nav-cat-toggle { display: block; background: var(--primary); color: #fff; padding: 10px 18px; font-weight: 600; min-width: 240px; }
.nav-cat-toggle:hover { color: #fff; }
.cat-dropdown { display: none; position: absolute; left: 0; top: 100%; background: #fff; min-width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.12); list-style: none; margin: 0; padding: 6px 0; border-radius: 0 0 8px 8px; z-index: 20; }
.nav-categories:hover .cat-dropdown { display: block; }
.cat-dropdown li { position: relative; }
.cat-dropdown a { display: block; padding: 8px 18px; }
.cat-dropdown ul { display: none; position: absolute; left: 100%; top: 0; background: #fff; min-width: 220px; list-style: none; padding: 6px 0; margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,.12); border-radius: 8px; }
.cat-dropdown li:hover > ul { display: block; }
.nav-menu { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-menu > li { position: relative; }
.nav-menu > li > a { display: block; padding: 10px 14px; font-weight: 600; }
.nav-menu > li.active > a { color: var(--primary); }
.sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; list-style: none; padding: 6px 0; margin: 0; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,.12); border-radius: 8px; z-index: 20; }
.sub-menu a { display: block; padding: 8px 16px; }
.nav-menu li:hover > .sub-menu { display: block; }
.sub-menu li { position: relative; }
.sub-menu .sub-menu { top: 0; left: 100%; }
.sub-menu li.has-sub > a::after, .cat-dropdown li.has-sub > a::after { content: '›'; float: right; margin-left: 10px; opacity: .6; }
.nav-overlay { display: none; }

/* Breadcrumb + alert */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0 0; margin: 0; font-size: .88rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a:hover { color: var(--primary); }
.alert { padding: 12px 16px; border-radius: 8px; margin: 12px 0; border: 1px solid; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.site-main { min-height: 50vh; padding-bottom: 32px; }
.site-main > .container > h1, .content > h1 { margin-top: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; border-bottom: 2px solid var(--border); }
.section-head h2 { margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--primary); margin-bottom: -2px; text-transform: uppercase; font-size: 1.1rem; }
.section-head a { color: var(--primary); font-size: .9rem; }
.empty { background: #fff; border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* Hero */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 16px; }
.hero:not(:has(.hero-side)) { grid-template-columns: 1fr; }
.hero-slider { position: relative; border-radius: var(--radius); overflow: hidden; background: #ddd; aspect-ratio: 860 / 400; }
.slides { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; left: 6%; top: 50%; transform: translateY(-50%); max-width: 55%; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.slide-caption h2 { font-size: clamp(1.2rem, 3vw, 2.2rem); }
.slider-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.slider-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.6); cursor: pointer; padding: 0; }
.slider-dots button.active { background: #fff; width: 24px; border-radius: 5px; }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.hero-side img { border-radius: var(--radius); width: 100%; height: 100%; object-fit: cover; }
.cat-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cat-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .88rem; }
.cat-icon img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.banner-middle { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.banner-middle img { border-radius: var(--radius); width: 100%; }

/* Lưới sản phẩm */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.product-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.pc-thumb { position: relative; display: block; aspect-ratio: 1; background: #f3f4f6; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-sale { position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-oos { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.6); color: #fff; text-align: center; padding: 4px; font-size: .85rem; }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-name { font-size: .93rem; font-weight: 500; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-final { color: var(--danger); font-weight: 700; font-size: 1.05rem; }
.price-old { color: var(--muted); font-size: .85rem; }
.pc-sold { font-size: .78rem; color: var(--muted); }
.pc-body .btn { margin-top: auto; }

/* Bài viết */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-thumb { display: block; aspect-ratio: 5 / 3; background: #eee; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 14px; }
.post-body h3 { font-size: 1.02rem; margin-bottom: 6px; }
.post-body p { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { color: var(--muted); font-size: .82rem; margin-bottom: 6px; }

/* Bố cục có sidebar */
.layout-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; margin-top: 16px; }
.layout-sidebar.sidebar-right { grid-template-columns: 1fr 300px; }
.sidebar .widget { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.sidebar-banner { display: block; margin-bottom: 16px; }
.sidebar-banner img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.widget-title { font-size: 1rem; text-transform: uppercase; margin-bottom: 10px; }
.cat-tree, .price-filter { list-style: none; padding: 0; margin: 0; }
.cat-tree a, .price-filter a { display: block; padding: 6px 0; }
.cat-tree a.active, .price-filter a.active { color: var(--primary); font-weight: 600; }
.cat-tree ul { list-style: none; padding-left: 14px; margin: 0; font-size: .92rem; }
/* Cây danh mục nhiều cấp: nút +/- mở / thu gọn nhánh con */
.cat-tree .cat-row { display: flex; align-items: center; gap: 6px; }
.cat-tree .cat-row a { flex: 1; min-width: 0; }
.cat-tree li.has-children > ul { display: none; }
.cat-tree li.has-children.open > ul { display: block; }
.cat-toggle { flex: none; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; position: relative; padding: 0; color: var(--muted, #666); }
.cat-toggle::before, .cat-toggle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; background: currentColor; transform: translate(-50%, -50%); }
.cat-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.cat-tree li.open > .cat-row .cat-toggle::after { display: none; }
.cat-toggle:hover { color: var(--primary); border-color: var(--primary); }
.price-form { display: flex; gap: 6px; margin-top: 10px; }
.price-form input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.list-head h1 { margin: 0; font-size: 1.4rem; }
.list-tools { display: flex; align-items: center; gap: 10px; }
.list-tools select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: .88rem; }
.category-desc { margin-top: 24px; background: #fff; padding: 20px; border-radius: var(--radius); }
.mini-products { list-style: none; padding: 0; margin: 0; }
.mini-products a { display: flex; gap: 10px; padding: 6px 0; font-size: .9rem; }
.mini-products img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.mini-products b { display: block; color: var(--danger); }

/* Phân trang */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: #fff; border: 1px solid var(--border); padding: 0 10px; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Chi tiết sản phẩm */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; background: #fff; border-radius: var(--radius); padding: 20px; margin-top: 16px; box-shadow: var(--shadow); }
.pd-main-image { position: relative; aspect-ratio: 1; background: #f3f4f6; border-radius: 8px; overflow: hidden; }
.pd-main-image img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.pd-thumbs button { border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; cursor: pointer; flex: none; overflow: hidden; }
.pd-thumbs button.active { border-color: var(--primary); }
.pd-thumbs img { width: 72px; height: 72px; object-fit: cover; }
.pd-info h1 { font-size: 1.5rem; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars span { color: var(--muted); letter-spacing: 0; }
.pd-price { background: #fafafa; padding: 14px 16px; border-radius: 8px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-price .price-final { font-size: 1.8rem; }
.badge-save { background: #fee2e2; color: var(--danger); padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.pd-short { color: #374151; margin-bottom: 14px; white-space: pre-line; }
.pd-buy { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.qty-box { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.qty-box button { width: 38px; border: 0; background: #f3f4f6; cursor: pointer; font-size: 1.1rem; }
.qty-box input { width: 56px; border: 0; text-align: center; -moz-appearance: textfield; padding: 8px 0; }
.qty-box input::-webkit-outer-spin-button, .qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-warn { color: var(--warning); font-weight: 600; }
.pd-policies { list-style: none; padding: 14px; margin: 0; border: 1px dashed var(--border); border-radius: 8px; display: grid; gap: 6px; font-size: .92rem; }
.pd-tabs { display: grid; gap: 16px; margin-top: 16px; }
.pd-content, .pd-reviews { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rich-content { overflow-wrap: break-word; }
.rich-content img { border-radius: 6px; margin: 10px auto; }
.rich-content table { border-collapse: collapse; width: 100%; }
.rich-content td, .rich-content th { border: 1px solid var(--border); padding: 8px; }
.rich-content blockquote { border-left: 4px solid var(--primary); margin: 1em 0; padding: 4px 16px; background: #fafafa; }
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .ql-align-justify { text-align: justify; }
.rich-content.collapsed { max-height: 600px; overflow: hidden; position: relative; }
.rich-content.collapsed::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, #fff); }
.collapse-toggle { display: block; margin: 12px auto 0; }
.review-list { list-style: none; padding: 0; margin: 0 0 20px; }
.review-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.review-list p { margin: 6px 0 0; }
.review-form { display: grid; gap: 10px; background: #fafafa; padding: 16px; border-radius: 8px; }
.review-form input[type=text], .review-form input[type=tel], .review-form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; }
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.8rem; color: #d1d5db; cursor: pointer; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #f59e0b; }
.mobile-buy-bar { display: none; }

/* Form */
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-weight: 500; font-size: .92rem; }
.form input:not([type=radio]):not([type=checkbox]):not([type=hidden]), .form textarea, .form select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 400; }
.form input:focus, .form textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
.form h2 { margin-top: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-error { color: var(--danger); font-size: .85rem; margin-top: -6px; }
.payment-options { display: grid; gap: 10px; }
.radio-card { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px; border: 1px solid var(--border); padding: 12px 14px; border-radius: 8px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, #fff); }
.radio-card input { margin-top: 4px; }
.radio-card small { display: block; color: var(--muted); font-weight: 400; }
.auth-box { max-width: 460px; margin-top: 30px; }

/* Giỏ hàng / thanh toán */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 80px 1fr auto 110px 30px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cl-name { font-weight: 600; display: block; margin-bottom: 4px; }
.cl-total { font-weight: 700; text-align: right; }
.cl-remove { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
.cl-remove:hover { color: var(--danger); }
.cart-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; }
.summary { display: grid; gap: 8px; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; }
.summary-row.discount b { color: var(--success); }
.summary-row.total { border-top: 1px solid var(--border); padding-top: 10px; font-size: 1.15rem; }
.summary-row.total b { color: var(--danger); }
.summary-note { font-size: .85rem; background: #fffbeb; padding: 8px 10px; border-radius: 6px; }
.coupon-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.coupon-form input[type=text] { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.checkout-items { list-style: none; padding: 0; margin: 0 0 12px; max-height: 320px; overflow: auto; }
.checkout-items li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checkout-items img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.checkout-items span { flex: 1; }
.checkout-items small { display: block; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table .tr { text-align: right; }
.table .tc { text-align: center; }
.table tfoot td { border-bottom: 0; padding: 6px 8px; }
.table tr.total td { border-top: 1px solid var(--border); font-size: 1.1rem; }
.table-wrap { overflow-x: auto; padding: 0; }
.success-box { text-align: center; padding: 32px 20px; margin-top: 20px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff; font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.order-code { color: var(--primary); font-size: 1.1em; }
.bank-grid { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.bank-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.status { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: #e5e7eb; vertical-align: middle; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipping { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #dcfce7; color: #166534; }
.status-cancelled { background: #f3f4f6; color: #4b5563; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 4px 0 8px 14px; position: relative; }
.timeline li::before { content: ""; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; position: absolute; left: -6px; top: 10px; }
.timeline time { color: var(--muted); font-size: .85rem; }

/* Bài viết / trang */
.article { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.layout-sidebar .article { margin-top: 0; }
.narrow .article { margin-top: 16px; }
.article-lead { font-size: 1.08rem; font-weight: 500; color: #374151; }
.share { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); margin-top: 20px; flex-wrap: wrap; }
.share a { color: var(--primary); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.map iframe { border-radius: 8px; }
.error-page { text-align: center; padding: 48px 16px; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.search-form.inline { margin: 20px auto; }

/* Footer */
.newsletter-strip { background: #fff; border-top: 1px solid var(--border); margin-top: 32px; }
.usp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 16px; }
.usp div { display: flex; flex-direction: column; }
.usp span { color: var(--muted); font-size: .85rem; }
.site-footer { background: #111827; color: #d1d5db; padding-top: 36px; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.footer-col h3 { color: #fff; font-size: 1rem; text-transform: uppercase; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-about .logo-text { color: #fff; }
.footer-about p { margin-top: 10px; }
.footer-bottom { border-top: 1px solid #1f2937; margin-top: 28px; padding: 14px 0; font-size: .85rem; color: #9ca3af; }

/* Nút liên hệ nổi */
.float-buttons { position: fixed; right: 16px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.float-buttons a { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.2); font-size: 1.3rem; }
.fb-zalo { background: #0068ff; font-size: .8rem !important; }
.fb-messenger { background: linear-gradient(45deg, #0099ff 0%, #a033ff 60%, #ff5280 85%, #ff7061 100%); }
.fb-phone { background: var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.6); } 70% { box-shadow: 0 0 0 14px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: #111827; color: #fff; padding: 12px 20px; border-radius: 8px; transition: transform .25s; z-index: 100; max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); }
.toast a { color: #fbbf24; margin-left: 10px; font-weight: 600; }

/* Responsive */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .header-hotline { display: none; }
  .nav-cat-toggle { min-width: 0; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .layout-sidebar, .layout-sidebar.sidebar-right { grid-template-columns: 1fr; }
  .layout-sidebar .sidebar[data-sidebar] { display: none; }
  .layout-sidebar .sidebar[data-sidebar].open { display: block; }
  .show-sm { display: inline-flex; }
  .product-detail { grid-template-columns: 1fr; }
  .cart-layout, .contact-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .usp { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: flex; }
  .main-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; background: #fff; transform: translateX(-100%); transition: transform .2s; z-index: 70; overflow-y: auto; border: 0; }
  .main-nav.open { transform: none; }
  .nav-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 65; }
  .nav-inner { flex-direction: column; padding: 0; }
  .nav-cat-toggle { display: none; }
  .cat-dropdown { display: block; position: static; box-shadow: none; padding: 0; border-bottom: 1px solid var(--border); }
  .cat-dropdown ul { position: static; display: block; box-shadow: none; padding-left: 14px; }
  .nav-menu { flex-direction: column; }
  .sub-menu { position: static; display: block; box-shadow: none; padding-left: 14px; }
  .header-main { gap: 12px; flex-wrap: wrap; }
  .search-form, .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .hide-sm { display: none; }
  .mobile-buy-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 10px 16px; box-shadow: 0 -2px 10px rgba(0,0,0,.1); justify-content: space-between; align-items: center; z-index: 55; }
  body:has(.mobile-buy-bar) .float-buttons { bottom: 80px; }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .product-grid, .product-grid.grid-3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .post-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 64px 1fr 30px; }
  .cart-line img { width: 64px; height: 64px; }
  .cart-line .qty-box { grid-column: 2; }
  .cart-line .cl-total { grid-column: 2; text-align: left; }
  .cart-line .cl-remove { grid-row: 1; grid-column: 3; }
  .topbar-inner { justify-content: center; }
  .topbar-right { display: none; }
  .slide-caption { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Giá "Liên hệ" (sản phẩm báo giá theo số lượng) */
.price-contact { color: var(--primary); }
.pd-quote { background: var(--bg); border: 1px dashed var(--primary); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.pd-quote p { margin: 0 0 10px; }
.pd-quote-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Gợi ý tìm kiếm */
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 80; overflow: hidden; max-height: 70vh; overflow-y: auto; }
.search-suggest .ss-title { font-size: 12px; text-transform: uppercase; color: var(--muted, #777); padding: 8px 14px 4px; }
.search-suggest a { display: flex; gap: 10px; align-items: center; padding: 7px 14px; color: inherit; text-decoration: none; }
.search-suggest a:hover, .search-suggest a.active { background: #f4f6fa; }
.search-suggest img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; background: #f4f4f4; }
.search-suggest .ss-name { flex: 1; font-size: 14px; line-height: 1.35; }
.search-suggest .ss-price { color: var(--primary); font-weight: 600; white-space: nowrap; font-size: 14px; }
.search-suggest .ss-all { justify-content: center; border-top: 1px solid var(--border); font-weight: 600; color: var(--primary); }
.search-suggest .ss-empty { padding: 14px; color: #777; }
.search-suggest mark { background: none; color: inherit; font-weight: 700; }

/* Mục lục bài viết */
html { scroll-behavior: smooth; }
.rich-content h2[id], .rich-content h3[id], .faq { scroll-margin-top: 90px; }
.toc { border: 1px solid var(--border); background: #f8fafc; border-radius: 10px; padding: 12px 18px; margin: 0 0 20px; display: inline-block; min-width: min(100%, 360px); max-width: 100%; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 8px 0 0; padding-left: 0; list-style: none; }
.toc ol ol { margin-top: 2px; padding-left: 18px; font-size: .95em; }
.toc li { margin: 3px 0; }
.toc a { color: inherit; }
.toc a:hover { color: var(--primary); }

/* Câu hỏi thường gặp */
.faq { margin: 28px 0; }
.faq h2 { font-size: 1.3rem; margin-bottom: 12px; }
.faq details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.faq summary { padding: 12px 16px; font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 40px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--primary); }
.faq details[open] summary::after { content: '−'; }
.faq .faq-a { padding: 0 16px 14px; white-space: pre-line; color: #444; }

/* Thanh quản trị khi admin xem trang khách */
.admin-bar { display: flex; gap: 16px; align-items: center; background: #1d2327; color: #f0f0f1; font-size: 13px; line-height: 20px; height: 32px; box-sizing: border-box; padding: 6px 16px; position: sticky; top: 0; z-index: 200; white-space: nowrap; overflow: hidden; }
.admin-bar-draft { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .has-admin-bar .main-nav { top: 32px; } .admin-bar-user { display: none; } }
.admin-bar a { color: #f0f0f1; text-decoration: none; }
.admin-bar a:hover { color: #72aee6; }
.admin-bar-draft { background: #dba617; color: #1d2327; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.admin-bar-user { margin-left: auto; opacity: .7; }
