/* Các trang cửa hàng ngoài trang chủ: danh sách, danh mục, chi tiết sản phẩm, giỏ hàng, bài viết. */
.catalog-page { padding-top: 18px; padding-bottom: 48px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span:last-child { color: var(--dark); }
.catalog-page .empty-state p a, .catalog-page .empty-state a { color: var(--orange); font-weight: 700; }
.category-description { margin: -4px 0 22px; line-height: 1.7; }
.category-description img, .product-description img, .article-page img { max-width: 100%; height: auto; }
.category-description figure { margin: 12px 0; }

/* Trang danh sách / danh mục: sidebar cây danh mục + nội dung */
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.catalog-main { min-width: 0; }
.cat-sidebar { position: sticky; top: 12px; }
.cat-sidebar-box { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.cat-sidebar-box > summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--orange); color: #fff; font-weight: 750; cursor: pointer; list-style: none; }
.cat-sidebar-box > summary::-webkit-details-marker { display: none; }
.cat-tree, .cat-tree ul { margin: 0; padding: 0; list-style: none; }
.cat-tree { padding: 6px 0; max-height: calc(100vh - 120px); overflow-y: auto; }
.cat-tree ul { padding-left: 14px; border-left: 2px solid #f4e4d9; margin: 0 0 4px 18px; }
.cat-tree a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 16px; color: #33404a; font-size: 13.5px; line-height: 1.35; }
.cat-tree ul a { padding: 5px 10px; font-size: 13px; }
.cat-tree a small { color: #9aa3a9; font-size: 11.5px; }
.cat-tree a:hover { color: var(--orange); }
.cat-tree a.is-current { color: var(--orange); font-weight: 750; background: #fff4ec; }
.cat-tree details > summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.cat-tree details > summary::-webkit-details-marker { display: none; }
.cat-tree details > summary a { flex: 1; }
.cat-tree details > summary::after { content: "▸"; padding: 0 14px 0 4px; color: #9aa3a9; font-size: 12px; transition: transform .15s; }
.cat-tree details[open] > summary::after { transform: rotate(90deg); }

/* Khung mua hàng (dùng ở trang chi tiết sản phẩm, xem thêm product-detail.css) */
.buy-box { display: grid; gap: 8px; max-width: 460px; margin-top: 18px; }
.buy-box label { font-size: 13px; font-weight: 700; color: var(--muted); }
.buy-box select { height: 42px; padding: 0 10px; border: 1px solid #d9dde0; border-radius: 6px; font: inherit; background: #fff; }
.buy-stock { margin: 0; color: var(--muted); font-size: 13px; }
.qty-stepper { display: inline-flex; width: max-content; border: 1px solid #d9dde0; border-radius: 6px; overflow: hidden; background: #fff; }
.qty-stepper button { width: 36px; border: 0; background: #f4f5f6; font-size: 18px; cursor: pointer; }
.qty-stepper button:hover { background: #ffe8d9; color: var(--orange); }
.qty-stepper input { width: 56px; height: 38px; border: 0; border-inline: 1px solid #d9dde0; font: inherit; text-align: center; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-error { min-height: 1em; margin: 0; color: #c62828; font-size: 13px; }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.buy-actions .button { justify-content: center; min-width: 170px; border: 2px solid var(--orange); font: inherit; font-weight: 750; cursor: pointer; }
.buy-actions .buy-add { background: #fff4ec; color: var(--orange); }
.buy-actions .button:disabled { opacity: .5; cursor: not-allowed; }
.buy-done { margin: 0; color: #2e7d32; font-weight: 650; }
.buy-done a { color: var(--orange); }

/* Giỏ hàng */
.cart-notice { padding: 10px 14px; border-radius: 6px; background: #fff4d6; color: #7a5a00; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cart-line.is-soldout { background: #fafafa; }
.cart-thumb { display: block; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; background: #f6f6f6; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-name { font-weight: 700; line-height: 1.35; }
.cart-name:hover { color: var(--orange); }
.cart-main small { color: var(--muted); }
.cart-unit { color: #e03d0a; font-weight: 700; font-size: 14px; }
.cart-warn { color: #c62828; font-size: 12.5px; font-style: normal; }
.cart-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line-total { font-size: 16px; }
.cart-remove, .cart-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.cart-remove:hover, .cart-clear:hover { color: #c62828; }
.cart-total { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cart-total > div { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total strong { color: #e03d0a; font-size: 22px; }
.cart-total .button { justify-content: center; }
.cart-contact-note, .cart-next { margin: 0; color: var(--muted); font-size: 13px; }

/* Đặt hàng */
.cart-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.checkout-form { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.checkout-form h3 { margin: 0 0 14px; font-size: 17px; text-transform: uppercase; }
.checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.checkout-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 650; color: #40506a; }
.checkout-grid label.is-wide { grid-column: 1 / -1; }
.checkout-grid b { color: #d9480f; }
.checkout-grid input, .checkout-grid textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9dde0; border-radius: 6px; font: inherit; font-weight: 400; color: var(--dark); background: #fff; }
.checkout-grid input:focus, .checkout-grid textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px #f65d1826; }
.checkout-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checkout-error { min-height: 0; margin: 0; color: #c62828; font-size: 13px; font-weight: 650; }
.checkout-error:empty { display: none; }
.checkout-submit { justify-content: center; border: 0; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.checkout-submit:disabled { opacity: .6; cursor: wait; }
.cart-shopee { color: var(--orange); font-size: 13px; font-weight: 700; text-align: center; }
.order-placed { max-width: 560px; margin: 24px auto; padding: 34px 28px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; }
.order-placed-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #e6f6ec; color: #2e7d32; font-size: 32px; font-weight: 800; }
.order-placed h1 { margin: 14px 0 8px; font-size: 26px; }
.order-placed p { color: var(--muted); }
.order-code { display: inline-block; margin: 2px 0 10px; padding: 8px 18px; border: 2px dashed var(--orange); border-radius: 8px; color: var(--orange); font-size: 24px; letter-spacing: .04em; }
.order-placed-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.order-home { color: var(--muted); font-weight: 650; }

/* Liên hệ */
.contact-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.contact-info, .contact-form-box { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.contact-info h3, .contact-form-box h3 { margin: 0 0 14px; font-size: 18px; text-transform: uppercase; }
.contact-info ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-info li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #f8f9fa; }
.contact-info b { display: block; font-size: 13px; }
.contact-info li span:not(.blk-feature-icon), .contact-info li a { color: #4b5661; font-size: 14px; }
.contact-info li a { color: var(--orange); font-weight: 700; }
.contact-help { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.contact-sent { margin-bottom: 12px; padding: 12px 14px; border-radius: 8px; background: #e6f6ec; color: #1b5e20; }
.contact-form .checkout-error { grid-column: 1 / -1; }
.contact-source { margin: 0; color: var(--muted); font-size: 13px; }
.contact-source a { color: var(--orange); }
.contact-map { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.contact-map iframe { display: block; width: 100%; height: 380px; border: 0; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } .contact-map iframe { height: 280px; } }

/* Bài viết */
.article-page { max-width: 860px; line-height: 1.7; }
.article-page h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.25; }
.article-summary { color: var(--muted); font-size: 17px; }

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; gap: 14px; }
  .cat-sidebar { position: static; }
  .cat-tree { max-height: 50vh; }
}
@media (max-width: 760px) {
  .buy-actions .button { flex: 1; min-width: 0; }
  .cart-layout { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-thumb { width: 64px; height: 64px; }
  .cart-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .cart-total { position: static; }
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-form { padding: 16px; }
}

/* Mã giảm giá trong giỏ */
.cart-discount { display: block !important; padding-top: 4px; border-top: 1px dashed var(--line); }
.cart-discount label { display: block; margin-bottom: 6px; color: #33404a; font-size: 13.5px; font-weight: 700; }
.cart-discount-row { display: flex; gap: 6px; }
.cart-discount-row input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #d9dde0; border-radius: 6px; font: inherit; text-transform: uppercase; }
.cart-discount-row input:focus { border-color: var(--orange); outline: 0; }
.cart-discount-row button { padding: 0 14px; border: 1px solid var(--orange); border-radius: 6px; background: #fff; color: #d9480f; font-weight: 750; cursor: pointer; }
.cart-discount-row button:hover { background: #fff4ec; }
.cart-discount-msg { min-height: 0; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.cart-discount-msg:empty { display: none; }
.cart-discount-msg.is-ok { color: #137a4e; }
.cart-discount-msg.is-error { color: #b83a32; }
.cart-total .cart-discount-line strong { color: #137a4e; font-size: 16px; }
.cart-discount-line button { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.cart-grand { padding-top: 10px; border-top: 1px solid var(--line); }
.cart-grand span { font-weight: 750; }
