/* =========================================================
   Anh Quân Store – giao diện chính
   ========================================================= */
:root {
    --primary: #0b57d0;
    --primary-dark: #0842a0;
    --accent: #f05a22;
    --accent-dark: #d4461a;
    --sale: #e11d48;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f3f4f6;
    --white: #fff;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.site-main { min-height: 60vh; padding-bottom: 40px; }

/* ---------- Nút ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important;
    transition: background .15s, color .15s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn--outline { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn--light { background: #fff; color: var(--primary); }
.btn--lg { padding: 12px 22px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }

/* ---------- Topbar & header ---------- */
.topbar { background: var(--primary-dark); color: #dbe6ff; font-size: 13px; }
.topbar a { color: #fff; }
.topbar__inner { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
.topbar__links a { margin-left: 16px; }

.header { background: var(--primary); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.header__inner { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 12px; }

.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none !important; flex-shrink: 0; }
.logo__mark {
    width: 40px; height: 40px; border-radius: 10px; background: var(--accent);
    display: grid; place-items: center; font-weight: 800; color: #fff;
}
.logo__text { font-weight: 800; font-size: 20px; line-height: 1; color: #fff; }
.logo__text small { display: block; font-size: 11px; letter-spacing: 4px; font-weight: 600; opacity: .85; }

.search { flex: 1; position: relative; display: flex; }
.search input {
    flex: 1; min-width: 0; height: 42px; border: 0; border-radius: 8px 0 0 8px; padding: 0 14px; font: inherit;
}
.search button { width: 52px; border: 0; border-radius: 0 8px 8px 0; background: var(--accent); color: #fff; cursor: pointer; }
.search__suggest {
    position: absolute; top: 46px; left: 0; right: 0; background: #fff; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; z-index: 60;
}
.search__suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--text); }
.search__suggest a:hover { background: var(--bg); text-decoration: none; }
.search__suggest img { width: 44px; height: 44px; object-fit: contain; }
.search__suggest b { display: block; color: var(--sale); font-size: 13px; }

.header__cart { display: flex; align-items: center; gap: 6px; color: #fff; position: relative; flex-shrink: 0; }
.header__cart-count {
    position: absolute; top: -6px; left: 14px; background: var(--accent); color: #fff; border-radius: 10px;
    font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px;
}

.nav-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

.nav { background: #fff; border-bottom: 1px solid var(--border); }
.nav__inner { display: flex; gap: 4px; }
.nav__item { position: relative; }
.nav__link { display: block; padding: 11px 14px; color: var(--text); font-weight: 600; }
.nav__link:hover, .nav__link.is-active { color: var(--primary); text-decoration: none; }
.nav__dropdown {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); border-radius: 0 0 8px 8px; padding: 6px 0; z-index: 55;
}
.nav__dropdown a { display: block; padding: 8px 16px; color: var(--text); }
.nav__dropdown a:hover { background: var(--bg); text-decoration: none; color: var(--primary); }
.nav__item:hover .nav__dropdown { display: block; }

/* ---------- Trang chủ ---------- */
.hero { padding: 16px 0; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; height: var(--slider-h, 300px); }
.slide {
    position: absolute; inset: 0; opacity: 0; transition: opacity .6s; display: flex; align-items: center;
    color: #fff; text-decoration: none !important;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide--0 { background: linear-gradient(120deg, var(--primary), #3b82f6 60%, #60a5fa); }
.slide--1 { background: linear-gradient(120deg, #0f172a, #1e3a8a 60%, #2563eb); }
.slide--2 { background: linear-gradient(120deg, var(--accent), #f59e0b); }
.slide__text { position: relative; padding: 0 48px; max-width: 620px; }
.slide__text h2 { font-size: 34px; margin-bottom: 8px; }
.slide__text p { font-size: 17px; opacity: .92; margin: 0 0 18px; }
.slider__dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.slider__dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.slider__dots button.is-active { background: #fff; width: 26px; border-radius: 5px; }

.cat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.cat-tile {
    background: #fff; border-radius: var(--radius); padding: 18px 12px; display: flex; flex-direction: column;
    align-items: center; gap: 8px; color: var(--text); font-weight: 600; text-align: center; box-shadow: var(--shadow);
    transition: transform .15s;
}
.cat-tile:hover { transform: translateY(-2px); text-decoration: none; }
.cat-tile svg { color: var(--primary); }
.cat-tile--camera svg { color: #0f766e; }
.cat-tile--solar_light svg { color: #d97706; }
.cat-tile--network svg { color: #7c3aed; }

.usp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.usp div { background: #fff; border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.usp b { display: block; }
.usp span { font-size: 13px; color: var(--muted); }

.promo {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 16px 0;
    background: linear-gradient(120deg, #ecfdf5, #fef3c7); border-radius: var(--radius); padding: 22px 28px;
}
.promo h2 { font-size: 20px; }
.promo p { margin: 0; color: #374151; }

/* ---------- Khối & lưới sản phẩm ---------- */
.section { margin-top: 24px; }
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section__head h2 { margin: 0; font-size: 21px; text-transform: uppercase; }
.section__links { display: flex; gap: 8px; flex-wrap: wrap; }
.section__links a { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 4px 12px; font-size: 13px; color: var(--text); }
.section__links a.section__all { border-color: var(--primary); color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(var(--grid-cols, 4), 1fr); gap: 12px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
    background: #fff; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow); transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); }
/* Ảnh phóng to vừa khung (contain) hoặc phủ kín (cover), chọn trong Giao diện Website */
.card__img { position: relative; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; display: block; }
.card__img > img:first-child { width: 100%; height: 100%; object-fit: var(--img-fit, contain); transition: transform .3s; }
.card:hover .card__img > img:first-child { transform: scale(1.04); }
.card__body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card__title { font-size: 14px; font-weight: 600; margin: 0; flex: 1; }
.card__title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__tag { font-size: 12px; color: #047857; background: #ecfdf5; border-radius: 4px; padding: 2px 8px; align-self: flex-start; }

.badge { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.badge--sale { background: var(--sale); color: #fff; }

.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price__now { color: var(--sale); font-weight: 700; font-size: 16px; }
.price__old { color: var(--muted); text-decoration: line-through; font-size: 13px; }

/* ---------- Breadcrumb, tiêu đề, chip ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding: 14px 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb__current { color: var(--text); }
.page-head h1, h1.page-head { font-size: 24px; }
.page-head small { font-size: 15px; color: var(--muted); font-weight: 400; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 6px 14px; color: var(--text); }
.chip.is-active, .chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ---------- Danh mục: lọc & sắp xếp ---------- */
.listing { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.filters { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); position: sticky; top: 120px; }
.filters__toggle { display: none; width: 100%; }
.filters fieldset { border: 0; border-bottom: 1px solid var(--border); margin: 0 0 12px; padding: 0 0 12px; }
.filters legend { font-weight: 700; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 14px; }
.check small { color: var(--muted); }
.filters__actions { display: flex; gap: 8px; }
.sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.sortbar span { color: var(--muted); }
.sortbar a { padding: 4px 12px; border-radius: 16px; color: var(--text); border: 1px solid var(--border); font-size: 14px; }
.sortbar a.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty { background: #fff; border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--text); border: 1px solid var(--border); }
.pagination .is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Chi tiết sản phẩm ---------- */
.pd { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.pd__main-img { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.pd__main-img > img:first-child { width: 100%; height: 100%; object-fit: contain; }
.pd__thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pd__thumbs button { width: 64px; height: 64px; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 4px; cursor: pointer; }
.pd__title { font-size: 22px; }
.pd__meta { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.in-stock { color: #047857; font-weight: 600; }
.out-stock { color: var(--sale); font-weight: 600; }
.pd__price { display: flex; align-items: baseline; gap: 12px; background: #fff7ed; border-radius: 8px; padding: 10px 14px; }
.pd__price .price__now { font-size: 28px; }
.pd__price .price__old { font-size: 16px; }
.pd__highlights { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pd__highlights li { background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.pd__highlights span { display: block; color: var(--muted); font-size: 12px; }
.pd__short { color: #374151; }
.pd__policies { padding-left: 18px; color: #374151; font-size: 14px; margin-bottom: 0; }

.buy-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 14px; }
.buy-box__group { margin-bottom: 12px; }
.buy-box__group h3 { font-size: 15px; margin-bottom: 8px; }
.addon {
    display: grid; grid-template-columns: auto 44px 1fr auto; gap: 10px; align-items: center;
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer;
}
.addon:has(input:checked) { border-color: var(--primary); background: #eff6ff; }
.addon img { width: 44px; height: 44px; object-fit: contain; }
.addon__name { font-size: 14px; }
.addon__name small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.addon__req { font-style: normal; font-size: 11px; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 6px; margin-left: 4px; }
.addon__price { font-weight: 700; color: var(--sale); text-align: right; font-size: 14px; white-space: nowrap; }
.addon__price s, .addon__price small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.addon--service { background: #f0fdf4; border-color: #bbf7d0; }
.addon--service:has(input:checked) { border-color: #16a34a; background: #dcfce7; }
.addon__icon { width: 44px; height: 44px; display: grid; place-items: center; color: #15803d; }

.buy-box__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.buy-box__total b { color: var(--sale); font-size: 20px; }
.buy-box__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.buy-box__actions .btn { flex: 1; min-width: 150px; }
.qty { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { width: 36px; border: 0; background: var(--bg); font-size: 18px; cursor: pointer; }
.qty input { width: 52px; border: 0; text-align: center; font: inherit; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.pd__detail { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; margin-top: 16px; align-items: start; }
.pd__desc, .pd__specs { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.pd__desc h2, .pd__specs h2 { font-size: 19px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table td:first-child { color: var(--muted); width: 42%; }
.spec-table__group th { text-align: left; background: var(--bg); padding: 8px 10px; font-size: 13px; text-transform: uppercase; }

/* ---------- So sánh ---------- */
.compare-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 14px; }
.compare th, .compare td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.compare thead th { width: 28%; }
.compare thead th:first-child { width: 16%; }
.compare thead img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 6px; }
.compare thead a span { color: var(--text); font-weight: 600; }
.compare__group th { background: var(--bg); text-transform: uppercase; font-size: 13px; }
.compare td:first-child { color: var(--muted); }
.compare tr.is-diff td:not(:first-child) { background: #fffbeb; }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- Thông báo nổi ---------- */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff;
    padding: 12px 20px; border-radius: 8px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px);
}
.compare-bar {
    position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid var(--primary);
    padding: 10px 16px; display: flex; justify-content: center; align-items: center; gap: 12px; z-index: 90;
}

.error-page { text-align: center; padding: 60px 16px; }
.error-page h1 { font-size: 48px; color: var(--primary); }

/* ---------- Footer ---------- */
.footer { background: #0f172a; color: #cbd5e1; padding-top: 36px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { color: #fff; margin: 0 0 10px; }
.footer a { display: block; color: #cbd5e1; padding: 3px 0; }
.footer .logo { margin-bottom: 10px; }
.footer__bottom { border-top: 1px solid #1e293b; margin-top: 28px; padding: 14px; text-align: center; color: #64748b; }
.float-contact { position: fixed; right: 16px; bottom: 80px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.float-contact a {
    width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    font-weight: 700; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.25); text-decoration: none;
}
.float-contact__zalo { background: #0068ff; }
.float-contact__call { background: #16a34a; }

.content p { margin: 0 0 1em; }


/* =========================================================
   Giỏ hàng, thanh toán, đơn hàng
   ========================================================= */
.btn--block { width: 100%; }
.btn.is-disabled { pointer-events: none; opacity: .5; }
.alert { border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.field-error { color: #dc2626; font-size: 13px; margin-top: 4px; }

.panel { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.panel h3 { font-size: 15px; margin: 18px 0 8px; }
.panel--install { border: 2px solid #bbf7d0; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; font-size: 14px; flex-shrink: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 8px 0; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field > span { font-weight: 600; }
.field--full { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
    font: inherit; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
.is-invalid { border-color: #dc2626 !important; }

.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.order-summary { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: sticky; top: 120px; }
.order-summary h2 { font-size: 17px; }
.order-summary dl, .order-totals { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0 16px; }
.order-summary dd, .order-totals dd { margin: 0; text-align: right; font-weight: 600; }
.order-summary__total { font-size: 17px; border-top: 1px solid var(--border); padding-top: 10px; }
dd.order-summary__total { color: var(--sale); font-size: 20px; }

.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.cart-item.has-error { outline: 2px solid #fecaca; }
.cart-item__img img { width: 96px; height: 96px; object-fit: contain; }
.cart-item__name { color: var(--text); font-weight: 600; }
.cart-item__price { color: var(--muted); font-size: 14px; }
.cart-item__children { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cart-item__children li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; background: var(--bg); border-radius: 6px; padding: 6px 10px; }
.cart-item__children form { margin-left: auto; }
.cart-item__tag { background: #e0e7ff; color: #3730a3; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.cart-item__tag--service { background: #dcfce7; color: #166534; }
.cart-item__child-price { color: var(--muted); }
.cart-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item__total { color: var(--sale); font-size: 17px; }

.map { height: 360px; border-radius: 8px; border: 1px solid var(--border); margin: 8px 0; z-index: 0; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.map-tools .btn { padding: 7px 12px; font-size: 14px; }
.map-info { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; background: #f0fdf4; border-radius: 8px; padding: 10px 12px; }
.pin span {
    display: block; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; background: #dc2626;
    transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.pay-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--primary); background: #eff6ff; }

.mini-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.mini-items li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; font-size: 13px; align-items: start; }
.mini-items img { width: 48px; height: 48px; object-fit: contain; }
.mini-items small { display: block; color: var(--muted); }
.mini-items span { font-weight: 600; }

.success-box { background: #fff; border-radius: var(--radius); padding: 32px; text-align: center; box-shadow: var(--shadow); margin: 16px 0; }
.success-box__icon { width: 64px; height: 64px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 36px; display: grid; place-items: center; margin: 0 auto 12px; }
.success-box h1 { color: #15803d; }
.bank-info { border: 2px dashed var(--primary); }

.order-detail__head { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 12px; }
.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th, .order-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; }
.order-table th:not(:first-child), .order-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.order-table__child td { color: var(--muted); font-size: 13px; }
.order-totals { max-width: 360px; margin-left: auto; }
.order-detail__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 14px; }
.status { border-radius: 12px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: #fef3c7; color: #92400e; }
.status--completed { background: #dcfce7; color: #166534; }
.status--cancelled { background: #fee2e2; color: #991b1b; }
.timeline { padding-left: 18px; font-size: 14px; }
.track-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

@media (max-width: 992px) {
    .checkout-layout { grid-template-columns: 1fr; }
    .order-summary { position: static; }
}
@media (max-width: 768px) {
    .form-grid, .order-detail__cols, .track-form { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 72px 1fr; }
    .cart-item__img img { width: 72px; height: 72px; }
    .cart-item__side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
    .map { height: 300px; }
    .order-table { font-size: 13px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .pd, .pd__detail { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .topbar__links { display: none; }
    .header__inner { flex-wrap: wrap; gap: 10px; }
    .search { order: 3; flex-basis: 100%; }
    .header__cart { margin-left: auto; }
    .header__cart span { display: none; }
    .nav-toggle { display: block; }
    .nav { display: none; }
    .nav.is-open { display: block; }
    .nav__inner { flex-direction: column; }
    .nav__dropdown { display: block; position: static; box-shadow: none; padding: 0 0 6px 14px; }
    .slider { height: 220px; }
    .slide__text { padding: 0 24px; }
    .slide__text h2 { font-size: 22px; }
    .cat-tiles, .usp { grid-template-columns: repeat(2, 1fr); }
    .promo { flex-direction: column; align-items: flex-start; }
    .grid, .grid--3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .listing { grid-template-columns: 1fr; }
    .filters { position: static; }
    .filters__toggle { display: flex; }
    .filters__form { display: none; margin-top: 12px; }
    .filters.is-open .filters__form { display: block; }
    .pd { padding: 14px; }
    .pd__highlights { grid-template-columns: 1fr; }
    .addon { grid-template-columns: auto 36px 1fr; }
    .addon__price { grid-column: 3; text-align: left; }
    .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Giai đoạn 4: mã giảm giá, tài khoản, đánh giá, tin tức ---------- */
.discount { color: #16a34a; }
.coupon-form { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.coupon-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; text-transform: uppercase; }
.auth-page { display: flex; justify-content: center; padding: 32px 0; }
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.auth-box h1 { font-size: 24px; margin: 0; }
.auth-box__alt { text-align: center; margin: 0; }
.social-login { display: grid; gap: 12px; }
.social-login__sep { display: flex; align-items: center; gap: 10px; color: var(--muted, #64748b); font-size: 13px; }
.social-login__sep::before, .social-login__sep::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.social-login__btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid #dadce0; background: #fff; color: #1f2937; transition: box-shadow .15s, background .15s; }
.social-btn:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.social-btn--facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.social-btn--facebook:hover { background: #166fe5; }
.social-links { display: grid; gap: 10px; }
.social-links__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; }
.social-links__row form { margin: 0; }
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; margin-bottom: 32px; }
.account-nav { display: flex; flex-direction: column; padding: 8px 0; }
.account-nav__user { padding: 12px 20px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.account-nav__user small { color: var(--muted); }
.account-nav a, .account-nav .link-btn { padding: 10px 20px; color: var(--text); text-align: left; border-left: 3px solid transparent; }
.account-nav a.is-active { color: var(--primary); border-left-color: var(--primary); background: #eff6ff; font-weight: 600; }
.account-nav a:hover { text-decoration: none; background: #f9fafb; }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-list__item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; color: var(--text); }
.order-list__item:hover { border-color: var(--primary); text-decoration: none; }
.order-list__item small { color: var(--muted); margin-left: 6px; }
.order-list__items { color: var(--muted); font-size: 14px; grid-column: 1; }
.order-list__total { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--sale); }
.address-list { display: flex; flex-direction: column; gap: 10px; }
.address-card { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.address-card.is-default { border-color: var(--primary); }
.address-card p { margin: 4px 0; }
.address-card__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.map--address { height: 300px; }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.cancel-form { display: flex; gap: 12px; align-items: end; }
.cancel-form .field { flex: 1; }
.topbar__links form { display: inline; }
.topbar__links .link-btn { color: inherit; font-size: inherit; }
@media (max-width: 768px) {
    .account-layout { grid-template-columns: 1fr; }
    .account-nav { flex-direction: row; flex-wrap: wrap; padding: 0; }
    .account-nav__user { display: none; }
    .account-nav a, .account-nav .link-btn { padding: 10px 12px; border-left: 0; border-bottom: 2px solid transparent; }
    .account-nav a.is-active { border-bottom-color: var(--primary); }
    .address-card { flex-direction: column; }
    .address-card__actions { flex-direction: row; align-items: center; gap: 14px; }
    .cancel-form { flex-direction: column; align-items: stretch; }
}
.stars { position: relative; display: inline-block; color: #d1d5db; letter-spacing: 1px; line-height: 1; }
.stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: #f59e0b; white-space: nowrap; }
.pd__rating { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.reviews { margin-top: 16px; }
.reviews__top { display: grid; grid-template-columns: 160px 1fr 1.3fr; gap: 24px; align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.reviews__score { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reviews__score b { font-size: 40px; line-height: 1; color: #f59e0b; }
.reviews__score small { color: var(--muted); }
.reviews__bars div { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.reviews__bars .bar { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.reviews__bars .bar span { display: block; height: 100%; background: #f59e0b; }
.reviews__form form { display: flex; flex-direction: column; gap: 8px; }
.reviews__form textarea { padding: 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 28px; color: #d1d5db; cursor: pointer; padding: 0 2px; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #f59e0b; }
.rating-input input:focus-visible + label { outline: 2px solid var(--primary); }
.review-list { display: flex; flex-direction: column; }
.review { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.review__head small { color: var(--muted); }
.review__verified { color: #16a34a; font-size: 13px; }
.review p { margin: 6px 0 0; }
@media (max-width: 768px) { .reviews__top { grid-template-columns: 1fr; } }
.article { max-width: 860px; margin: 0 auto 32px; }
.article h1 { font-size: 26px; margin-top: 0; }
.article__date { color: var(--muted); margin-top: -6px; }
.article__cover { width: 100%; border-radius: 8px; margin-bottom: 16px; }
.content h2 { font-size: 20px; margin: 1.2em 0 .5em; }
.content h3 { font-size: 17px; margin: 1em 0 .4em; }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1em; }
.content li { margin-bottom: .3em; }
.content img { max-width: 100%; height: auto; border-radius: 6px; }
.content table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.content td, .content th { border: 1px solid var(--border); padding: 8px; text-align: left; }
.contact-layout { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; align-items: start; margin-bottom: 32px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.post-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.post-card:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.post-card__img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0b57d0, #f05a22); display: grid; place-items: center; color: #fff; font-weight: 700; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 14px 16px; }
.post-card__body small { color: var(--muted); }
.post-card__body h3 { font-size: 16px; margin: 4px 0 6px; line-height: 1.4; }
.post-card__body p { color: var(--muted); font-size: 14px; margin: 0; }
@media (max-width: 900px) { .post-grid { grid-template-columns: 1fr 1fr; } .contact-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }
.header__account { display: none; color: #fff; }
.account-nav .link-btn { text-decoration: none; font-size: 15px; width: 100%; }
@media (max-width: 768px) { .header__account { display: flex; align-items: center; margin-left: auto; } .header__account + .header__cart { margin-left: 4px; } }
.contact-map { width: 100%; height: 260px; border: 0; border-radius: 8px; margin-top: 14px; }

/* ---------- Cấu hình giao diện (Hệ thống > Giao diện Website) ---------- */
.badge-new { position: absolute; top: 8px; right: 8px; width: 54px; height: auto; z-index: 2; pointer-events: none; }
.pd__main-img .badge-new { width: 72px; top: 12px; right: 12px; }
.logo__img { max-height: 48px; width: auto; }
.footer__logo { max-height: 56px; width: auto; margin-bottom: 10px; background: #fff; border-radius: 6px; padding: 4px; }
.topbar__note { margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.3); }
.slide img { object-position: right center; }
.slide--img::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 65%); }
.slide__text--on-image { z-index: 2; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.no-sticky .header { position: relative; }
.no-topbar .header__account { display: flex; align-items: center; margin-left: auto; }
.no-topbar .header__account + .header__cart { margin-left: 4px; }
@media (max-width: 992px) { .grid { grid-template-columns: repeat(min(var(--grid-cols, 4), 3), 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid { grid-template-columns: repeat(2, 1fr); } .slider { height: min(var(--slider-h, 300px), 220px); } }

/* Chia sẻ mạng xã hội (dưới ảnh sản phẩm) */
.pd__thumbs { flex-wrap: wrap; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.share__label { color: var(--muted); font-size: 14px; margin-right: 2px; }
.share__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 50%; border: 0; color: #fff; font: 700 12px/1 inherit; cursor: pointer; text-decoration: none; transition: transform .15s, opacity .15s; }
.share__btn:hover { transform: translateY(-2px); opacity: .9; color: #fff; }
.share__btn--fb { background: #1877f2; }
.share__btn--zalo { background: #0068ff; border-radius: 17px; }
.share__btn--x { background: #111; }
.share__btn--pin { background: #e60023; }
.share__btn--tg { background: #27a7e7; }
.share__btn--copy, .share__btn--more { background: #6b7280; }
.share__done { font-size: 13px; color: #15803d; }

/* Tag SEO */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 6px; }
.tags__label { font-weight: 600; margin-right: 4px; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13px; text-decoration: none; border: 1px solid var(--border); }
.tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Yêu thích */
.btn--wish { padding-left: 14px; padding-right: 14px; color: #e11d48; }
.btn--wish.is-on { background: #fff1f2; border-color: #e11d48; }
.wish-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #e11d48; color: #fff; font-size: 11px; text-align: center; }
.bank-info--qr { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.bank-info__qr { width: 220px; height: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.grid--wish .wish-item { display: flex; flex-direction: column; gap: 6px; }
.buy-box__actions .btn--wish { flex: 0 0 auto; min-width: 0; width: 52px; padding: 0; }
.pd__thumbs button { overflow: hidden; font-size: 10px; }
.pd__main-img { overflow: hidden; }

/* ---- Chống tràn màn hình (mọi cỡ màn hình) ---- */
html, body { max-width: 100%; overflow-x: clip; }
.grid > *, .grid--3 > *, .cat-tiles > *, .usp > *, .listing > *, .pd > *, .pd__detail > *, .pd__highlights > *, .footer__grid > *,
.form-grid > *, .checkout-layout > *, .cart-item > *, .mini-items li > *, .order-detail__cols > *, .track-form > *, .account-layout > * { min-width: 0; }
.field input, .field select, .field textarea { max-width: 100%; }
img, video, iframe, svg, canvas { max-width: 100%; }
img { height: auto; }
.card__name, .card__title, .pd__title, .cart-item, .content, .breadcrumb, .order-detail, .panel, .alert, .footer { overflow-wrap: anywhere; }
.content img { height: auto !important; }
.content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.content pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }
.content td, .content th { border: 1px solid var(--border); padding: 6px 10px; }
.content blockquote { border-left: 4px solid var(--border); margin: 10px 0; padding: 4px 14px; color: #475569; }
.breadcrumb { flex-wrap: wrap; }
.share, .tags, .buy-box__actions, .sortbar { max-width: 100%; }
.article__lead { font-size: 1.05em; color: #334155; border-left: 4px solid var(--primary); padding: 4px 14px; margin: 12px 0 18px; background: #f8fafc; }

/* Logo: nền trắng bo góc để giữ đúng màu đỏ, xanh của logo trên mọi màu đầu trang */
.header .logo__img { max-height: 48px; max-width: 260px; height: auto; background: #fff; border-radius: 10px; padding: 5px 10px; object-fit: contain; }
@media (max-width: 600px) { .header .logo__img { max-height: 38px; max-width: 46vw; padding: 4px 8px; } }
.footer__logo { max-width: 100%; padding: 6px 10px; border-radius: 10px; }

/* Thông số kỹ thuật theo nhóm (camera), nằm dưới mục chia sẻ */
.pd__detail--single { grid-template-columns: 1fr; }
.spec-panel { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.spec-panel__title { font-size: 17px; margin: 0; padding: 14px 16px 10px; }
.spec-panel__tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); padding: 0 8px; scrollbar-width: thin; }
.spec-panel__tabs a { flex: 0 0 auto; padding: 9px 10px; font-size: 14px; color: #4b5563; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.spec-panel__tabs a:hover { color: var(--primary); }
.spec-panel__tabs a.is-active { color: #dc2626; border-bottom-color: #dc2626; font-weight: 600; }
.spec-panel__body { position: relative; max-height: 560px; overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.spec-panel__group h3 { font-size: 16px; margin: 14px 0 8px; }
.spec-panel__table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 14px; }
.spec-panel__table th, .spec-panel__table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.spec-panel__table tr:last-child th, .spec-panel__table tr:last-child td { border-bottom: 0; }
.spec-panel__table th { width: 38%; background: #f8fafc; font-weight: 400; color: #374151; border-right: 1px solid var(--border); }
@media (max-width: 600px) { .spec-panel__body { max-height: 70vh; padding: 4px 10px 12px; } .spec-panel__table th { width: 42%; } }

/* Nút lên đầu trang */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 81; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); display: grid; place-items: center;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s, transform .2s, visibility .2s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--primary-dark); }
.to-top:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.float-contact { bottom: 76px; }

/* ---------- Quảng cáo ---------- */
.ad-top { display: grid; gap: 12px; margin: 0 0 16px; }
.ad-top--2 { grid-template-columns: 1fr 1fr; }
.ad-top--3 { grid-template-columns: repeat(3, 1fr); }
.ad-top__item { display: block; border-radius: 12px; overflow: hidden; background: #f1f5f9; min-width: 0; }
.ad-top__item img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; transition: transform .2s; }
.ad-top__item:hover img { transform: scale(1.01); }
@media (max-width: 768px) { .ad-top--2, .ad-top--3 { grid-template-columns: 1fr; } .ad-top { gap: 8px; } }

/* Hai bên: phủ kín khoảng trống ngoài khung nội dung, từ dưới menu (--ad-top, ads.js cập nhật khi cuộn) xuống đáy màn hình;
   tối đa 2 banner chia đôi chiều cao, ảnh được cắt vừa khung. */
.ad-side { --ad-w: calc((100vw - 1200px) / 2 - 16px); display: none; position: fixed; top: var(--ad-top, 160px); bottom: 14px; width: var(--ad-w); z-index: 40;
           flex-direction: column; gap: 10px; }
.ad-side--left { left: 12px; }
.ad-side--right { right: 12px; }
.ad-side a { display: block; flex: 1 1 0; min-height: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(15, 23, 42, .15); background: #f1f5f9; }
.ad-side img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ad-side .ad-close { top: 6px; right: 6px; }
@media (min-width: 1350px) { .ad-side { display: flex; } }
.ad-side { pointer-events: none; }
.ad-side > * { pointer-events: auto; }

.ad-close { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .75);
            color: #fff; font-size: 17px; line-height: 22px; text-align: center; cursor: pointer; padding: 0; }
.ad-close:hover { background: #dc2626; }

.ad-popup { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .6); display: flex; align-items: center; justify-content: center;
            padding: 24px 16px; opacity: 0; transition: opacity .2s; }
.ad-popup[hidden] { display: none; }
.ad-popup.is-open { opacity: 1; }
.ad-popup__box { position: relative; max-width: min(560px, 100%); transform: scale(.95); transition: transform .2s; }
.ad-popup.is-open .ad-popup__box { transform: none; }
.ad-popup__box a { display: block; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.ad-popup__box img { display: block; width: 100%; height: auto; max-height: calc(100vh - 80px); object-fit: contain; background: #fff; }
.ad-popup__close { top: -12px; right: -12px; width: 34px; height: 34px; font-size: 22px; line-height: 32px; background: #fff; color: #0f172a;
                   box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.ad-popup__close:hover { background: #fee2e2; color: #dc2626; }
html.ad-popup-open { overflow: hidden; }
@media (max-width: 600px) { .ad-popup__close { top: -14px; right: -6px; } }

/* ---------- Bộ lọc cột trái: mỗi nhóm xổ xuống ---------- */
.filters { padding: 6px 14px 14px; }
@media (min-width: 769px) { .filters { max-height: calc(100vh - 136px); overflow-y: auto; overscroll-behavior: contain; } }
.filters__title { display: flex; align-items: center; gap: 8px; padding: 10px 0 10px; font-weight: 700; border-bottom: 1px solid var(--border); }
.filters__title svg { color: var(--primary); }
.fgroup { border-bottom: 1px solid var(--border); }
.fgroup > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 0; font-weight: 700; cursor: pointer; user-select: none; }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary:hover { color: var(--primary); }
.fgroup > summary b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 12px; }
.fgroup__chev { margin-left: auto; color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.fgroup[open] .fgroup__chev { transform: rotate(180deg); color: var(--primary); }
.fgroup__body { padding: 0 0 12px; max-height: 260px; overflow-y: auto; }
.filters__actions { margin-top: 14px; }
.btn--sm { padding: 7px 14px; font-size: 14px; }
.filter-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; }
.filter-tags > span { color: var(--muted); }
.filter-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 16px; background: #eef4ff; color: var(--primary); border: 1px solid #c7d8fb; }
.filter-tag i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-style: normal; font-size: 13px; line-height: 1; }
.filter-tag:hover { text-decoration: none; border-color: var(--primary); }
.filter-tags__clear { color: var(--danger, #dc2626); font-weight: 600; }

/* ---------- Menu chính (thiết kế mới) ---------- */
.nav { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(15, 23, 42, .02); }
.nav__inner { display: flex; align-items: stretch; gap: 2px; }
.nav__item { position: relative; display: flex; align-items: stretch; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 12px 14px; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav__link::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary);
                    transform: scaleX(0); transition: transform .2s; }
.nav__link:hover, .nav__link.is-active, .nav__item:focus-within > .nav__link { color: var(--primary); text-decoration: none; }
.nav__link.is-active::after, .nav__item:hover > .nav__link::after { transform: scaleX(1); }
.nav__icon { flex-shrink: 0; color: var(--muted); transition: color .15s; }
.nav__link:hover .nav__icon, .nav__link.is-active .nav__icon { color: var(--primary); }
.nav__chev { color: var(--muted); transition: transform .2s; }
.nav__item:hover > .nav__link .nav__chev { transform: rotate(180deg); color: var(--primary); }
.nav__expand { display: none; }
.nav__dropdown {
    display: block; position: absolute; top: calc(100% + 1px); left: 0; min-width: 260px; max-width: 460px; z-index: 55;
    background: #fff; border: 1px solid var(--border); border-radius: 0 0 14px 14px; box-shadow: 0 16px 36px rgba(15, 23, 42, .14); padding: 12px;
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.nav__item:hover > .nav__dropdown, .nav__item:focus-within > .nav__dropdown { opacity: 1; visibility: visible; transform: none; }
.nav__dropdown-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
                      font-weight: 700; color: var(--primary); }
.nav__dropdown-head .nav__icon { color: var(--primary); }
.nav__dropdown-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; }
.nav__dropdown-list:has(> a:only-child), .nav__dropdown-list:not(:has(> a:nth-child(4))) { grid-template-columns: 1fr; }
.nav__dropdown-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav__dropdown-list a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; transition: background .15s; }
.nav__dropdown-list a:hover, .nav__dropdown-list a.is-active { background: #eef4ff; color: var(--primary); text-decoration: none; }
.nav__dropdown-list a:hover::before, .nav__dropdown-list a.is-active::before { background: var(--primary); }
.nav__dropdown-all { display: block; margin-top: 8px; padding: 9px 10px 2px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--primary); }
.nav__item:nth-last-child(-n+2) > .nav__dropdown { left: auto; right: 0; }
@media (max-width: 1100px) and (min-width: 769px) { .nav__link { padding: 12px 10px; font-size: 14px; } .nav__icon { display: none; } .nav__link::after { left: 10px; right: 10px; } }
@media (max-width: 768px) {
    .nav { display: none; border-top: 1px solid var(--border); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); max-height: calc(100vh - 120px); overflow-y: auto; }
    .nav.is-open { display: block; }
    .nav__inner { flex-direction: column; gap: 0; padding: 6px 0; }
    .nav__item { flex-wrap: wrap; border-bottom: 1px solid #f1f5f9; }
    .nav__item:last-child { border-bottom: 0; }
    .nav__link { flex: 1; padding: 12px 4px; }
    .nav__link::after { display: none; }
    .nav__link .nav__chev { display: none; }
    .nav__icon { color: var(--primary); }
    .nav__expand { display: grid; place-items: center; width: 44px; background: none; border: 0; color: var(--muted); cursor: pointer; }
    .nav__expand[aria-expanded="true"] .nav__chev { transform: rotate(180deg); color: var(--primary); }
    .nav__dropdown { position: static; flex-basis: 100%; display: none; opacity: 1; visibility: visible; transform: none; min-width: 0; max-width: none;
                     border: 0; border-radius: 10px; box-shadow: none; background: #f8fafc; padding: 6px; margin: 0 0 10px; }
    .nav__item.is-expanded > .nav__dropdown { display: block; }
    .nav__item:hover > .nav__dropdown { opacity: 1; }
    .nav__dropdown-head { display: none; }
    .nav__dropdown-list { grid-template-columns: 1fr 1fr; }
    .nav__dropdown-all { margin-top: 4px; }
}
@media (min-width: 769px) {
    .nav__dropdown { width: max-content; min-width: 280px; max-width: 520px; }
    .nav__dropdown-list a { white-space: nowrap; padding-right: 18px; }
}

/* ---------- Trang tin tức (AQ2) ---------- */
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-bottom: 24px; }
.news-main { min-width: 0; }
.news-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.news-head .page-head { margin: 0; }
.news-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.news-tabs a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.news-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.news-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.news-topic { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #fff; background: var(--primary); text-decoration: none !important; }
.news-topic--laptop { background: #2563eb; }
.news-topic--camera { background: #0f766e; }
.news-topic--solar { background: #d97706; }
.news-topic--khac { background: #6b7280; }
a.news-topic:hover { color: #fff; opacity: .9; }

.news-article { min-width: 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.news-article__head h1 { font-size: 30px; line-height: 1.28; margin: 12px 0 14px; color: #0f172a; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.news-meta > * + *:not(.news-meta__who)::before { content: "•"; margin-right: 14px; color: #cbd5e1; }
.news-meta a { color: var(--muted); }
.news-meta b { color: var(--text); }
.news-meta__avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 700; font-size: 15px; }
.news-meta__avatar--lg { width: 52px; height: 52px; font-size: 20px; }
.news-article__cover { margin: 20px 0 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #e2e8f0; }
.news-article__cover img { width: 100%; height: 100%; object-fit: cover; }
.news-article__lead { font-size: 17px; font-weight: 600; line-height: 1.6; color: #334155; margin: 20px 0; }
.news-article__lead p { margin: 0; }
.news-article__body { font-size: 16.5px; line-height: 1.75; color: #1e293b; }
.news-article__body h2 { font-size: 22px; margin: 1.5em 0 .6em; color: #0f172a; }
.news-article__body h3 { font-size: 18px; margin: 1.2em 0 .5em; }
.news-article__body p { margin: 0 0 1.1em; }
.news-article__body blockquote { border-left: 4px solid var(--primary); background: #f8fafc; padding: 10px 16px; border-radius: 0 8px 8px 0; color: #334155; }
.news-article__body table { font-size: 15px; }
.news-article__body th { background: #f1f5f9; }
.news-article__foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.news-article__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.news-article__tags-label { font-weight: 700; margin-right: 2px; }
.news-author { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 16px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--border); }
.news-author p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.news-comments { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.news-comments h2 { font-size: 20px; }
.comment-list { list-style: none; margin: 0 0 20px; padding: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.comment__head time { color: var(--muted); font-size: 13px; }
.comment__body p { margin: 4px 0 0; overflow-wrap: anywhere; }
.comment__reply { margin-top: 10px; padding: 10px 14px; background: #eff6ff; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; font-size: 14px; }
.comment-form { display: grid; gap: 12px; padding: 18px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--border); }
.comment-form h3 { margin: 0; font-size: 17px; }
.comment-form label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.comment-form label small { font-weight: 400; color: var(--muted); }
.comment-form input, .comment-form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; }
.comment-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.news-side { position: sticky; top: 90px; display: grid; gap: 16px; min-width: 0; }
.news-side__box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.news-side__box h3 { font-size: 16px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); display: inline-block; }
.news-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-mini a { display: flex; gap: 10px; color: var(--text); text-decoration: none; }
.news-mini a:hover b { color: var(--primary); }
.news-mini__img { flex: none; width: 88px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, #0b57d0, #f05a22); }
.news-mini__img img { width: 100%; height: 100%; object-fit: cover; }
.news-mini__text { min-width: 0; display: grid; gap: 2px; }
.news-mini__text b { font-size: 14px; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-mini__text small { color: var(--muted); font-size: 12px; }
.news-topics { list-style: none; margin: 0; padding: 0; }
.news-topics a { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--text); }
.news-topics li:last-child a { border-bottom: 0; }
.news-topics a span { min-width: 26px; text-align: center; border-radius: 999px; background: #f1f5f9; font-size: 12px; padding: 2px 8px; color: var(--muted); }
.news-topics a.is-active, .news-topics a:hover { color: var(--primary); text-decoration: none; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.news-tags .tag { font-size: 12.5px; padding: 4px 10px; }
.news-cta { background: linear-gradient(160deg, #0b57d0, #0842a0); color: #fff; }
.news-cta h3 { border-color: #fff; }
.news-cta p { font-size: 14px; opacity: .92; margin: 0 0 12px; }
.news-cta .btn + .btn { margin-top: 8px; }
.news-cta .btn--outline { color: #fff; border-color: rgba(255,255,255,.7); background: transparent; }

.news-featured { display: grid; grid-template-columns: 1.25fr 1fr; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 18px; color: var(--text); }
.news-featured:hover { text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.news-featured__img { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #0b57d0, #f05a22); }
.news-featured__img img { width: 100%; height: 100%; object-fit: cover; }
.news-featured__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; min-width: 0; }
.news-featured__body .news-topic { align-self: flex-start; }
.news-featured__body h2 { font-size: 22px; margin: 0; line-height: 1.35; }
.news-featured__body p { margin: 0; color: #475569; }
.news-featured:hover h2, .post-card:hover h3 { color: var(--primary); }
.news-card-meta { color: var(--muted); font-size: 13px; }
.post-grid--2 { grid-template-columns: repeat(2, 1fr); }
.post-card__img { position: relative; }
.post-card__topic { position: absolute; left: 10px; top: 10px; }
.post-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card__body h3 { margin: 0; }
.post-card__body .news-card-meta { margin-top: auto; padding-top: 4px; }

@media (max-width: 1024px) { .news-layout { grid-template-columns: minmax(0, 1fr) 280px; } .news-article { padding: 22px; } }
@media (max-width: 900px) {
    .news-layout { grid-template-columns: 1fr; }
    .news-side { position: static; }
    .news-featured { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .news-article { padding: 16px; border-radius: 0; margin: 0 -16px; box-shadow: none; }
    .news-article__head h1 { font-size: 23px; }
    .news-article__body { font-size: 16px; }
    .news-meta > * + *:not(.news-meta__who)::before { margin-right: 8px; }
    .comment-form__row, .post-grid--2 { grid-template-columns: 1fr; }
    .news-featured__body { padding: 16px; }
    .news-featured__body h2 { font-size: 19px; }
}
