/* =========================================================================
   Bạch Đằng Book — shop catalogue + product detail
   Palette matches the theme's actual cascaded header color (#0070e0, from
   style.css/stylesheet.css, which override header.scss.css's #eb3e32) ·
   gold #ffb416 · dark #323c42
   Self-contained; no dependency on the scraped theme JS.
   ========================================================================= */
:root {
  --brand: #0070e0;
  --brand-dark: #005ab3;
  --gold: #ffb416;
  --ink: #323c42;
  --muted: #6c757d;
  --line: #e5e5e5;
  --bg: #f5f5f5;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, .12);
  --touch-target: 44px;
}

* { box-sizing: border-box; }
html {
  /* The off-canvas drawer/branch panel sit off-screen via translateX(), which
     browsers still count toward the document's scrollable area — without this
     the whole page gains a phantom horizontal scrollbar/scroll-left gap. */
  overflow-x: hidden;
}
body.shop {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ---------- header (matches the scraped theme header layout) ---------- */
.site-header { background: #fff; box-shadow: var(--shadow); position: relative; z-index: 50; }
.site-header__top {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 0;
}
.site-header__logo img { height: 46px; width: auto; }
.site-search { flex: 1; max-width: 560px; display: flex; }
.site-search input,
.site-search button {
  /* iOS/Android give buttons/inputs native chrome (rounded corners, shadow)
     that breaks the segmented pill look, making the joins look "split". */
  -webkit-appearance: none; appearance: none; outline: none; box-shadow: none;
  margin: 0;
}
.site-search input {
  flex: 1; height: 42px; border: 2px solid var(--brand); border-right: 0;
  border-radius: 22px 0 0 22px; padding: 0 18px; font-size: 14px; min-width: 0;
}
.site-search button[type="submit"] {
  width: 54px; height: 42px; border: 0; background: var(--brand); color: #fff; cursor: pointer;
  border-radius: 0 22px 22px 0; font-size: 16px; flex-shrink: 0;
}
.site-search button[type="submit"]:hover { background: var(--brand-dark); }
.site-search__mic {
  display: none; width: 42px; height: 42px; border: 2px solid var(--brand); border-left: 0;
  border-right: 0;
  background: #fff; color: var(--brand); cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.site-search__mic.listening { background: #ffe8e6; color: #dc3545; }
@media (max-width: 767px) {
  .site-search__mic { display: inline-flex; align-items: center; justify-content: center; }
}
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-header__hotline { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.site-header__hotline b { display: block; color: var(--brand); font-size: 17px; }
.branch-finder-btn {
  display: none; border: 1px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 20px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.branch-finder-btn:hover { background: var(--brand); color: #fff; }
@media (max-width: 767px) {
  /* icon-only on phones — the full-text pill was the main cause of the
     header row overflowing past the right edge of the screen */
  .branch-finder-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; flex-shrink: 0;
  }
  .branch-finder-btn__label { display: none; }
}
.branch-finder-panel {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); width: calc(100% - 32px);
  max-width: 380px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-hover);
  padding: 14px; z-index: 300;
}
.branch-finder__loading { text-align: center; padding: 10px; color: var(--muted); font-size: 14px; }
.branch-finder__item {
  display: flex; justify-content: space-between; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid #f2f2f2; font-size: 13.5px;
}
.branch-finder__item span { color: var(--muted); font-size: 12.5px; }
.branch-finder__dist { text-align: right; white-space: nowrap; font-weight: 600; color: var(--brand); font-size: 13px; }
.branch-finder__dist a { display: block; font-weight: 400; font-size: 12px; margin-top: 2px; }
.branch-finder__close {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; padding: 8px; cursor: pointer; font-size: 13.5px; color: var(--muted);
}
.site-header__icons { display: flex; gap: 18px; }
.site-header__icons a { position: relative; font-size: 22px; line-height: 1; color: var(--ink); }
.site-header__icons a:hover { color: var(--brand); }
.site-header__icons .badge {
  position: absolute; top: -6px; right: -8px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* nav bar: [ DANH MỤC SẢN PHẨM box ] [ horizontal menu ] */
.site-nav { background: var(--brand); }
.site-nav__inner { display: flex; align-items: stretch; }
.site-nav__cat { position: relative; width: 260px; flex-shrink: 0; }
.site-nav__cat-title {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  color: #fff; font-weight: 600; font-size: 15px;
  cursor: pointer;
}
@media (hover: hover) {
  .site-nav__cat-title:hover { background: rgba(0, 0, 0, .14); }
}
.site-nav__cat-menu {
  position: absolute; top: 100%; left: 0; width: 260px; background: #fff;
  box-shadow: var(--shadow-hover); border-radius: 0 0 6px 6px; overflow: hidden;
  list-style: none; margin: 0; padding: 6px 0; z-index: 60;
  display: none;
}
.site-nav__cat:hover .site-nav__cat-menu { display: block; }
.site-nav__cat-menu li a { display: block; padding: 9px 16px; font-size: 14px; color: var(--ink); border-bottom: 1px solid #f2f2f2; }
.site-nav__cat-menu li:last-child a { border-bottom: 0; }
.site-nav__cat-menu li a:hover { color: var(--brand); background: #fafafa; }
.site-nav__cat-skel { height: 14px; margin: 9px 16px; border-radius: 4px; background: #eee; animation: pulse 1.2s ease-in-out infinite; }
.site-nav__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.site-nav__menu a {
  display: flex; align-items: center; height: 44px; color: #fff; padding: 0 18px;
  font-size: 15px; font-weight: 600;
}
.site-nav__menu a.active { background: rgba(0, 0, 0, .14); }
@media (hover: hover) {
  .site-nav__menu a:hover { background: rgba(0, 0, 0, .14); }
}

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 14px 0; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; }

/* ---------- layout ---------- */
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding-bottom: 40px; align-items: start; }

/* ---------- sidebar categories ---------- */
.sidebar { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sidebar__title {
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
  padding: 12px 16px; text-transform: uppercase; display: flex; align-items: center; gap: 8px;
}
.cat-tree { list-style: none; margin: 0; padding: 6px 0; }
.cat-tree li { position: relative; }
.cat-tree a {
  display: block; padding: 9px 16px; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid #f2f2f2;
}
.cat-tree > li > a { font-weight: 600; }
.cat-tree a:hover { color: var(--brand); background: #fafafa; }
.cat-tree a.active { color: var(--brand); font-weight: 700; }
.cat-tree .sub { list-style: none; margin: 0; padding: 0; display: none; background: #fafafa; }
.cat-tree li.open > .sub { display: block; }
.cat-tree .sub a { padding-left: 30px; font-weight: 400; font-size: 13.5px; }
.cat-tree__toggle {
  position: absolute; right: 8px; top: 6px; width: 26px; height: 26px; border: 0;
  background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1;
}
.cat-tree li.open > .cat-tree__toggle { transform: rotate(90deg); }

/* ---------- toolbar ---------- */
.shop-main { min-width: 0; }
.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.shop-toolbar__title { font-size: 20px; font-weight: 700; margin: 0; }
.shop-toolbar__title small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.shop-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.shop-sort select {
  height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px;
  font-size: 14px; color: var(--ink); background: #fff; cursor: pointer;
}

/* ---------- product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-card__badge {
  position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}
.product-card__thumb { aspect-ratio: 1 / 1; padding: 12px; display: flex; align-items: center; justify-content: center; }
.product-card__thumb img { max-height: 100%; width: auto; object-fit: contain; }
.product-card__body { padding: 0 12px 14px; display: flex; flex-direction: column; flex: 1; }
.product-card__name {
  font-size: 14px; font-weight: 500; color: var(--ink); margin: 0 0 8px; min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__name:hover { color: var(--brand); }
.product-card__price { margin-top: auto; }
.price-now { color: var(--brand); font-weight: 700; font-size: 17px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 13px; margin-left: 6px; }
.btn-cart {
  margin-top: 10px; width: 100%; height: 38px; border: 1px solid var(--brand); color: var(--brand);
  background: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: .15s;
}
.btn-cart:hover { background: var(--brand); color: #fff; }

/* ---------- states ---------- */
.state { text-align: center; padding: 60px 20px; color: var(--muted); }
.skeleton { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); height: 300px;
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 28px 0 10px; flex-wrap: wrap; }
.pagination button {
  min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pagination button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination button:disabled { opacity: .45; cursor: default; }

/* ---------- product detail ---------- */
.pd { display: grid; grid-template-columns: 440px 1fr; gap: 32px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.pd__gallery { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pd__gallery img { width: 100%; height: auto; object-fit: contain; max-height: 460px; }
.pd__title { font-size: 24px; font-weight: 700; margin: 0 0 12px; }
.pd__meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.pd__meta b { color: var(--ink); }
.pd__price { background: var(--bg); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.pd__price .price-now { font-size: 28px; }
.pd__actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.qty { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.qty button { width: 40px; border: 0; background: #f7f7f7; cursor: pointer; font-size: 18px; }
.qty input { width: 54px; border: 0; text-align: center; font-size: 15px; }
.btn-primary {
  height: 46px; padding: 0 28px; border: 0; background: var(--brand); color: #fff; border-radius: 6px;
  font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: var(--brand-dark); }
.pd__desc { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.pd__desc h2 { font-size: 18px; border-left: 4px solid var(--brand); padding-left: 10px; margin: 0 0 16px; }
.pd__desc img { height: auto; margin: 10px 0; }
.pd__desc table { max-width: 100%; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfd4d8; margin-top: 40px; padding: 28px 0; font-size: 13px; }
.site-footer a:hover { color: #fff; }
.site-footer__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 24px; font-size: 14px;
  box-shadow: var(--shadow-hover); opacity: 0; pointer-events: none; transition: .25s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   Content pages (about / news / recruitment / contact / cart)
   Shared look built on the same tokens as the catalogue above.
   ========================================================================= */
.page { padding-bottom: 40px; }
.page__hero {
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: var(--radius); padding: 34px 32px; margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.page__hero h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.page__hero p { margin: 0; opacity: .9; font-size: 15px; }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 28px; margin-bottom: 24px;
}
.card h2 {
  font-size: 19px; font-weight: 700; margin: 0 0 16px;
  border-left: 4px solid var(--brand); padding-left: 12px;
}
.card h3 { font-size: 16px; font-weight: 700; margin: 22px 0 10px; color: var(--brand-dark); }

/* rich text */
.prose { font-size: 15px; color: #3d474e; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--brand); }
.prose a:hover { text-decoration: underline; }
.prose strong { color: var(--ink); }

/* store branches */
.branch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.branch-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: box-shadow .2s, transform .2s; background: #fff;
}
.branch-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.branch-card__thumb { width: 100%; height: 140px; object-fit: cover; display: block; background: #f2f2f2; }
.branch-card__body { padding: 12px 18px 16px; }
.branch-card h4 { margin: 0 0 8px; font-size: 15px; color: var(--brand-dark); }
.branch-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.branch-card .addr::before { content: "📍 "; }

/* contact layout */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f2f2f2; font-size: 14.5px; }
.info-list li:last-child { border-bottom: 0; }
.info-list .ico { font-size: 20px; line-height: 1.3; }
.info-list b { display: block; color: var(--ink); margin-bottom: 2px; }
.info-list span { color: var(--muted); }
.info-list a { color: var(--brand); }

/* forms */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px;
  font-size: 14px; font-family: inherit; color: var(--ink); outline: none; transition: border-color .15s;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--brand); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: 13px; color: var(--muted); margin-top: 14px; }

/* photo attach (phones only — camera capture) */
.photo-attach-field { display: none; }
@media (max-width: 767px) {
  .photo-attach-field { display: block; }
}
.photo-attach__btn {
  border: 1px dashed var(--brand); background: #fff; color: var(--brand);
  border-radius: 8px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.photo-attach__preview { position: relative; display: inline-block; margin-top: 10px; }
.photo-attach__preview img { max-width: 140px; max-height: 140px; border-radius: 8px; display: block; object-fit: cover; }
.photo-attach__remove {
  position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; min-height: var(--touch-target, 44px); border-radius: 50%;
  border: 0; background: #dc3545; color: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.photo-attach__remove:hover { background: #c82333; }

/* modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  align-items: center; justify-content: center; z-index: 200; padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; padding: 24px 26px; position: relative;
}
.modal-box h2 { margin: 0 0 4px; }
.modal-box .modal-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.modal-close {
  position: absolute; top: 14px; right: 16px; border: 0; background: none;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted);
}
.modal-close:hover { color: var(--ink); }

/* news / job listing */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.news-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.news-card__thumb { aspect-ratio: 16 / 9; background: #eef3f8; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.news-card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.news-card__date { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.news-card__title { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.news-card__title:hover { color: var(--brand); }
.news-card__excerpt { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; flex: 1; }
.news-card__more { font-size: 13.5px; font-weight: 600; color: var(--brand); }

.job-list { display: flex; flex-direction: column; gap: 14px; }
.job-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  transition: box-shadow .2s;
}
.job-card:hover { box-shadow: var(--shadow-hover); }
.job-card__info h4 { margin: 0 0 6px; font-size: 16px; }
.job-card__info p { margin: 0; font-size: 13.5px; color: var(--muted); }
.job-card__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tag { background: #eef3f8; color: var(--brand-dark); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* empty state */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state .ico { font-size: 54px; margin-bottom: 12px; }
.empty-state h2 { border: 0; padding: 0; justify-content: center; display: block; }

/* cart / bulk-order list */
.cart-empty { text-align: center; padding: 40px 20px; }
.cart-empty .ico { font-size: 64px; margin-bottom: 14px; }
.cart-empty p { color: var(--muted); margin: 0 0 20px; }
.cart-row {
  display: grid; grid-template-columns: 64px 1fr auto auto auto; gap: 14px;
  align-items: center; padding: 14px 0; border-bottom: 1px solid #f2f2f2;
}
.cart-row:last-child { border-bottom: 0; }
.cart-row__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #f2f2f2; }
.cart-row__name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.cart-row__unit { font-size: 13px; color: var(--muted); }
.cart-row__total { font-weight: 700; color: var(--brand); min-width: 100px; text-align: right; }
.cart-row__remove { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.cart-row__remove:hover { color: #dc3545; }
.cart-summary {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 18px 0 4px; font-size: 16px;
}
.cart-summary b { color: var(--brand); font-size: 20px; }
.cart-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cart-note { font-size: 13px; color: var(--muted); margin: 4px 0 18px; }

/* =========================================================================
   Auth (login / register)
   ========================================================================= */
@media (max-width: 767px) {
  body.auth-page .site-header { display: none; }
  body.auth-page .breadcrumb { display: none; }
  body.auth-page .site-footer { display: none; }
  body.auth-page .bottom-tab-bar { display: none; }
  body.auth-page > div.container { min-height: 100vh; display: flex; align-items: center; padding: 20px 0; }
}
.auth-wrap { display: flex; justify-content: center; padding: 40px 0 60px; }
.auth-card {
  width: 100%; max-width: 440px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 30px;
}
.auth-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; text-align: center; }
.auth-card__sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth-card .btn-primary { width: 100%; justify-content: center; margin-top: 4px; }
.auth-card__alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.auth-card__alt a { color: var(--brand); font-weight: 600; }
.auth-card__alt a:hover { text-decoration: underline; }
.auth-card__divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12.5px; }
.auth-card__divider::before, .auth-card__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-outline {
  display: flex; width: 100%; align-items: center; justify-content: center;
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 6px; padding: 12px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn-outline:hover { background: var(--bg); }

/* =========================================================================
   Homepage
   ========================================================================= */
.home-hero {
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 46px 40px; margin: 20px 0 28px; text-align: center;
}
.home-hero h1 { margin: 0 0 10px; font-size: 30px; font-weight: 800; }
.home-hero p { margin: 0 0 22px; font-size: 16px; opacity: .92; }
.home-hero .btn-primary { background: var(--gold); color: var(--ink); }
.home-hero .btn-primary:hover { background: #ffa600; }

/* classic "old" top row: vertical category menu + banner slider */
.home-top { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin: 20px 0 30px; }
.home-menu { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; height: 400px; }
.home-menu .sidebar__title { flex-shrink: 0; }
.home-menu .cat-tree { flex: 1; overflow: auto; }

.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #e9eef3; height: 400px; }
.slider__track { display: flex; height: 100%; transition: transform .5s ease; }
.slide { min-width: 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .8); color: var(--ink); font-size: 20px; line-height: 40px;
  box-shadow: var(--shadow); transition: background .15s;
}
.slider__arrow:hover { background: #fff; }
.slider__arrow--prev { left: 12px; }
.slider__arrow--next { right: 12px; }
.slider__dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.slider__dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .6); cursor: pointer; }
.slider__dots button.active { background: var(--brand); }

.section { margin-bottom: 34px; }
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 18px;
}
.section__head h2 { margin: 0; font-size: 20px; font-weight: 700; text-transform: uppercase; color: var(--ink); }
.section__head a { color: var(--brand); font-size: 14px; font-weight: 600; }
.section__head a:hover { text-decoration: underline; }

.cat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; font-weight: 600; font-size: 14.5px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.cat-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--brand); color: var(--brand); }
.cat-tile .ico { display: block; font-size: 30px; margin-bottom: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .shop-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .pd { grid-template-columns: 1fr; }
  .site-nav__cat { display: none; } /* the sidebar/category list covers this on mobile */
  .site-nav__menu { overflow-x: auto; flex-wrap: nowrap; }
  .contact-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
  .home-top { grid-template-columns: 1fr; }
  .home-menu { display: none; } /* categories remain in the header dropdown on mobile */
  .slider { height: 300px; }
}
@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .branch-grid, .news-grid { grid-template-columns: 1fr; }
  .page__hero { padding: 24px 20px; }
  .card { padding: 20px 18px; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
  .home-hero { padding: 32px 20px; }
  .home-hero h1 { font-size: 24px; }
  .cart-row {
    position: relative; display: flex; flex-wrap: wrap; align-items: center;
    gap: 10px 14px; padding-right: 26px;
  }
  .cart-row__total { text-align: left; }
  .cart-row__remove { position: absolute; top: 14px; right: 0; }
}

/* =========================================================================
   Mobile navigation — hamburger drawer + bottom tab bar
   Added because the source theme only ever did `display:none` on the
   category rail/hotline under 767px with nothing replacing them. This adds
   the standard iOS-shop pattern: a slide-in drawer for nav+categories and a
   persistent bottom tab bar, both gated to phone widths (≤767px) so the
   existing desktop/tablet layout is untouched.
   ========================================================================= */

.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--touch-target, 44px);
  height: var(--touch-target, 44px);
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  gap: 4px;
}
.nav-hamburger:hover { background: #f2f2f2; }
.nav-hamburger__bars { position: relative; width: 22px; height: 16px; }
.nav-hamburger__bars span {
  position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-hamburger__bars span:nth-child(1) { top: 0; }
.nav-hamburger__bars span:nth-child(2) { top: 7px; }
.nav-hamburger__bars span:nth-child(3) { top: 14px; }

.nav-drawer__overlay {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 300;
  opacity: 0; transition: opacity .25s;
}
.nav-drawer__overlay.show { display: block; }
.nav-drawer__overlay.in { opacity: 1; }

.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 320px;
  background: #fff; z-index: 301; transform: translateX(-100%); transition: transform .28s ease;
  display: flex; flex-direction: column; box-shadow: var(--shadow-hover);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 8px 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.nav-drawer__head img { height: 34px; width: auto; }
.nav-drawer__close {
  width: var(--touch-target); height: var(--touch-target); border: 0; background: transparent;
  font-size: 20px; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.nav-drawer__close:hover { background: #f2f2f2; color: var(--ink); }
.nav-drawer__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.nav-drawer__hotline {
  display: block; padding: 14px 18px; background: var(--bg); font-size: 13px; color: var(--muted);
}
.nav-drawer__hotline b { display: block; color: var(--brand); font-size: 18px; margin-top: 2px; }
.nav-drawer__section-title {
  padding: 14px 18px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.nav-drawer__menu, .nav-drawer__cats { list-style: none; margin: 0; padding: 0 0 8px; }
.nav-drawer__menu a, .nav-drawer__cats a {
  display: flex; align-items: center; min-height: var(--touch-target);
  padding: 0 18px; font-size: 15.5px; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid #f5f5f5;
}
.nav-drawer__cats a { font-weight: 400; font-size: 14.5px; }
.nav-drawer__menu a.active, .nav-drawer__cats a.active { color: var(--brand); }
.nav-drawer__menu a:active, .nav-drawer__cats a:active { background: #fafafa; }

.bottom-tab-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 250;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-tab-bar__row { display: flex; }
.bottom-tab-bar a, .bottom-tab-bar__more {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: 56px; font-size: 10.5px; font-weight: 600; color: var(--muted); position: relative;
}
.bottom-tab-bar__more {
  border: 0; background: transparent; font-family: inherit; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.bottom-tab-bar a.active { color: var(--brand); }
.bottom-tab-bar__ico { font-size: 21px; line-height: 1; }
.bottom-tab-bar__badge {
  position: absolute; top: 2px; right: calc(50% - 20px); background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* drawer settings section: bottom-bar ↔ side-rail layout toggle */
.nav-drawer__mode-toggle { padding: 4px 18px 18px; }
.nav-mode-switch { display: flex; gap: 8px; }
.nav-mode-switch button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 10px; padding: 10px 6px; font-size: 13px; font-weight: 600; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.nav-mode-switch button.active { border-color: var(--brand); color: var(--brand); background: #eaf3ff; }

@media (max-width: 767px) {
  .nav-hamburger { display: inline-flex; }
  .site-nav__menu { display: none; }
  body.shop { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0)); }
  .bottom-tab-bar { display: block; }

  /* Header: [hamburger][logo][branch+user+cart] on the top row, search
     dropped to its own full-width row underneath — the icons no longer
     compete with the search bar for space. */
  .site-header__top { flex-wrap: wrap; row-gap: 10px; column-gap: 12px; padding: 10px 0; }
  .site-header__logo img { height: 36px; }
  .site-header__hotline { display: none; }
  .site-header__actions { order: 3; margin-left: auto; gap: 10px; }
  .site-header__icons { gap: 14px; }
  .site-header__icons a { font-size: 24px; }
  .site-search { order: 4; flex-basis: 100%; max-width: 100%; width: 100%; min-width: 0; }

  /* Layout toggle: "side" mode turns the bottom tab bar into a vertical
     rail pinned to the left edge instead of a fixed strip along the bottom. */
  body.nav-mode-side.shop { padding-bottom: 0; padding-left: calc(64px + env(safe-area-inset-left, 0)); }
  body.nav-mode-side .bottom-tab-bar {
    left: 0; right: auto; top: 0; bottom: 0; width: calc(64px + env(safe-area-inset-left, 0));
    border-top: 0; border-right: 1px solid var(--line);
    padding-bottom: 0; padding-left: env(safe-area-inset-left, 0);
  }
  body.nav-mode-side .bottom-tab-bar__row { flex-direction: column; height: 100%; }
  body.nav-mode-side .bottom-tab-bar a,
  body.nav-mode-side .bottom-tab-bar__more { flex: 0 0 auto; height: 64px; font-size: 9.5px; }
  body.nav-mode-side .bottom-tab-bar__badge { right: calc(50% - 22px); }

  /* the mobile header is now two rows tall (icons row + full-width search),
     so the branch-finder popover needs to clear more space than on desktop */
  .branch-finder-panel { top: 116px; }

  /* 44px minimum touch targets on phone, even where the source used less */
  .qty button { height: var(--touch-target); width: var(--touch-target); font-size: 20px; }
  .qty input { height: var(--touch-target); }
  .cart-row__remove { width: var(--touch-target); height: var(--touch-target); font-size: 20px; }
  .pagination button { min-width: var(--touch-target); height: var(--touch-target); }
  .modal-close { width: var(--touch-target); height: var(--touch-target); display: flex; align-items: center; justify-content: center; }
  .btn-cart, .cat-tree__toggle { min-height: var(--touch-target); }
  /* keep the search pill's segments the same height on phones — a min-height
     only on the buttons made them taller than the input, so their joins no
     longer lined up */
  .site-search input, .site-search button, .site-search button[type="submit"] { height: var(--touch-target); }
  .cat-tree__toggle { width: var(--touch-target); }
  .form-field input, .form-field textarea, .shop-sort select { font-size: 16px; min-height: var(--touch-target); }

  /* modal becomes a bottom sheet so it never fights the tab bar / keyboard */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    max-width: 100%; width: 100%; max-height: 85vh; border-radius: 16px 16px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0));
  }
}
