/* Public pages stylesheet (landing, privacy, terms, about, data-deletion, support).
   Served by BE at /static/public.css. Single source — no inline styles in templates. */

:root {
  /* Brand */
  --brand: #FF6B35;
  --brand-2: #F7931E;
  /* Text scale (đậm -> nhạt) — mọi chỗ dùng token, không hard-code */
  --text: #1a1a1a;        /* tiêu đề, nội dung chính */
  --text-secondary: #555; /* mô tả phụ (tagline, paragraph) */
  --text-muted: #888;     /* label nhỏ */
  --text-faint: #bbb;     /* ghi chú mờ */
  --on-brand: #fff;       /* chữ trên nền cam/ảnh */
  /* Surface */
  --bg: #f7f8fa;          /* nền trang */
  --surface: #fff;        /* nền card */
  --soft: #faf9f8;        /* nền ô nhạt (feature) */
  --border: #eee;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  background: var(--bg);
}

/* Top nav (mọi trang public) */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 14px 20px;
}
.topnav__brand img {
  height: 52px; width: auto; object-fit: contain; display: block;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.topnav__links { display: flex; align-items: center; gap: 18px; }
/* Chỉ link thường lấy màu text; nút (.btn) giữ màu riêng (chữ trắng trên nền cam) */
.topnav__links a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--text); }
.topnav__links a:not(.btn):hover { color: var(--brand); }
.topnav__cart { position: relative; font-size: 20px; text-decoration: none; }
.btn--sm { padding: 8px 18px; font-size: 14px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 8px 20px 32px; }
.card { background: var(--surface); border-radius: 12px; padding: 32px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

a { color: var(--brand); }
h1 { color: var(--brand); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--on-brand);
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  border: 1.5px solid var(--brand);
  cursor: pointer;
  transition: opacity .15s;
}
.btn:hover { opacity: .9; }
.btn--outline { background: var(--surface); color: var(--brand); }
/* nút nhỏ (topnav) — override cả padding lẫn font để nhất quán */
.btn--sm { padding: 9px 20px; font-size: 14px; }

.muted { color: var(--text-muted); font-size: 14px; }
/* Footer cuối tài liệu (privacy/terms) — border + chữ mờ, dùng token */
.doc-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* Hero */
.hero { text-align: center; padding: 24px 0 8px; }
.hero__logo { height: 88px; width: auto; max-width: 240px; object-fit: contain; margin-bottom: 16px; }
.hero__title { font-size: 2.6rem; margin: 0 0 10px; }
.hero__tagline { font-size: 1.15rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto 28px; }
.hero__cta { margin-left: 10px; }

/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; text-align: center; margin: 8px 0; }
.stat { flex: 1; min-width: 140px; }
.stat__num { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat__label { color: var(--text-muted); font-size: 14px; }

/* Intro (giới thiệu CLB) */
.intro { max-width: 680px; margin: 0 auto; text-align: center; }
.intro p { color: var(--text-secondary); margin: 0 0 14px; }
.intro__links { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* Footer chung mọi trang public */
.site-footer { margin-top: 24px; text-align: center; }
.site-footer__social { display: flex; gap: 14px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.site-footer__social a { font-weight: 600; text-decoration: none; }
.site-footer p { margin: 4px 0; }

/* Section heading */
.section-title { text-align: center; margin-bottom: 24px; }

/* Google Map embed */
.map { border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.1); margin-bottom: 16px; }
.map iframe { width: 100%; height: 360px; border: 0; display: block; }

/* Features grid */
.grid { display: flex; flex-wrap: wrap; gap: 20px; }
.feature { flex: 1; min-width: 220px; background: var(--soft); border-radius: 12px; padding: 20px; }
.feature__icon { font-size: 1.8rem; }
.feature h3 { margin: 8px 0 6px; }
.feature p { color: var(--text-secondary); font-size: 14px; margin: 0; }

/* Steps */
.steps { display: flex; flex-wrap: wrap; gap: 20px; text-align: center; }
.step { flex: 1; min-width: 180px; }
.step__num {
  width: 44px; height: 44px; line-height: 44px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 700; margin: 0 auto 10px;
}
.step h3 { margin: 0 0 6px; }
.step p { color: var(--text-secondary); font-size: 14px; margin: 0; }

.center { text-align: center; }
.mt-lg { margin-top: 36px; }

/* 404 */
.notfound { text-align: center; padding: 40px 0; }
.notfound__code { font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1; }
.notfound__title { margin: 8px 0; }
.notfound__text { color: var(--text-secondary); margin: 0 0 24px; }
.notfound__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Hero slider (JS auto-play; ảnh/clip đặt trong .slide) */
.slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--soft);
}
.slider__track { display: flex; height: 100%; transition: transform .6s ease; }
.slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-brand); font-size: 1.4rem; font-weight: 700;
  background-size: cover; background-position: center;
}
.slide video, .slide img { width: 100%; height: 100%; object-fit: cover; }
.slider__dots { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; }
.slider__dots span {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,.5); margin: 0 4px; cursor: pointer;
}
.slider__dots span.active { background: var(--on-brand); }

/* Public posts */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.post-card { display: block; background: var(--soft); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.post-card__img { width: 100%; height: 160px; object-fit: cover; display: block; }
.post-card__body { padding: 16px; }
.post-card__title { margin: 0 0 8px; font-size: 1.1rem; }
.post-card__excerpt { color: var(--text-secondary); font-size: 14px; margin: 0; }
.post-detail__img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin: 16px 0; }
.post-detail__content { color: var(--text); white-space: pre-wrap; line-height: 1.7; }

/* ===== Shop ===== */
.shop-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.shop-header .section-title { margin-bottom: 0; }
.cart-badge {
  display: inline-block; background: var(--brand); color: var(--on-brand);
  font-size: 12px; font-weight: 700; border-radius: 99px;
  padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}

/* Shop grid (product list) */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.shop-card {
  display: block; background: var(--soft); border-radius: 12px;
  overflow: hidden; text-decoration: none; color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: box-shadow .15s;
}
.shop-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.10); }
.shop-card__img { width: 100%; height: 180px; object-fit: cover; display: block; }
.shop-card__img--placeholder { display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--text-muted); font-size: 13px; }
.shop-card__body { padding: 14px; }
.shop-card__name { margin: 0 0 6px; font-size: 1rem; color: var(--text); }
.shop-card__price { margin: 0; font-size: 14px; color: var(--brand); font-weight: 600; }

/* Shop detail */
/* ─── Product detail (2 cột: gallery + info) ─── */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.pd__gallery { position: sticky; top: 20px; }
.pd__main-img { width: 100%; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: var(--soft); }
.pd__main-img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pd__main-img--empty { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pd__thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pd__thumb { width: 64px; height: 64px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: none; }
.pd__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd__thumb--active { border-color: var(--brand); }

.pd__name { margin: 0 0 12px; font-size: 1.8rem; }
.pd__price { font-size: 1.8rem; font-weight: 800; color: var(--brand); min-height: 1.6em; margin-bottom: 16px; }
.pd__desc { color: var(--text-secondary); margin: 0 0 24px; line-height: 1.6; }
.pd__opt { margin-bottom: 18px; }
.pd__opt-label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pd__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pd__swatch {
  border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface);
  padding: 8px 16px; font-size: 15px; color: var(--text); cursor: pointer; transition: all .15s;
}
.pd__swatch:hover { border-color: var(--brand); }
.pd__swatch--active { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.pd__field-input {
  border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 12px;
  font-size: 15px; color: var(--text); background: var(--surface); width: 100%; max-width: 320px;
}
.pd__field-input:focus { outline: none; border-color: var(--brand); }
.pd__checkbox { font-size: 15px; color: var(--text); }
.pd__buy { display: flex; align-items: center; gap: 16px; margin: 24px 0 12px; flex-wrap: wrap; }
.pd__qty { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.pd__qty-btn { border: none; background: var(--soft); width: 40px; height: 44px; font-size: 20px; cursor: pointer; color: var(--text); }
.pd__qty-input { border: none; width: 56px; height: 44px; text-align: center; font-size: 16px; color: var(--text); background: var(--surface); }
.pd__qty-input:focus { outline: none; }
.pd__addline { min-width: 140px; height: 48px; font-size: 15px; }
.pd__addline:disabled { opacity: .5; cursor: not-allowed; }
.pd__add { width: 100%; height: 48px; font-size: 16px; margin-top: 12px; }
.pd__back { margin-top: 20px; }

/* Bảng dòng đã chọn (nhiều tổ hợp / 1 order) */
.pd__lines { margin-top: 20px; }
.pd__lines-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pd__lines-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 12px; }
.pd__lines-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.pd__line-meta { font-size: 12px; color: var(--text-muted); }
.pd__line-del { border: none; background: none; color: var(--brand); cursor: pointer; font-size: 16px; }
.pd__total-label { text-align: right; font-weight: 600; }
.pd__total { font-weight: 800; color: var(--brand); }

/* Modal thông báo shop (thay alert) */
.shop-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.shop-modal[hidden] { display: none; }
.shop-modal__box { background: var(--surface); border-radius: 12px; padding: 24px; max-width: 90%; width: 360px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.shop-modal__msg { margin: 0 0 16px; color: var(--text); font-size: 15px; }

/* Lightbox xem ảnh sản phẩm lớn (ảnh full contain, mobile pinch-zoom) */
/* Lightbox dùng chung — ảnh sản phẩm + QR thanh toán. z-index > checkout-modal (1000). */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; z-index: 1200; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 96vw; max-height: 92vh; object-fit: contain; touch-action: pinch-zoom; user-select: none; background: #fff; }
.lightbox__close { position: fixed; top: 12px; right: 16px; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: var(--on-brand); font-size: 28px; line-height: 1; cursor: pointer; z-index: 1201; }
.lightbox__nav { position: fixed; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: var(--on-brand); font-size: 32px; line-height: 1; cursor: pointer; z-index: 1201; }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__nav[hidden] { display: none; }

/* Cart page — 2 cột: items + summary/form */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
.cart-main {}
.cart-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 20px; }
.cart-items { margin-bottom: 8px; }
.cart-empty { padding: 40px 0; }
.cart-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.cart-item__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-item__name { font-weight: 700; }
.cart-item__opts { font-size: 13px; color: var(--text-secondary); }
.cart-item__meta { font-size: 12px; color: var(--text-muted); }
.cart-item__unit { font-size: 13px; color: var(--text-muted); }
.cart-item__right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.cart-item__qty { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.cart-qty-btn { border: none; background: var(--soft); width: 30px; height: 32px; font-size: 16px; cursor: pointer; color: var(--text); }
.cart-qty-val { min-width: 32px; text-align: center; font-size: 14px; }
.cart-item__price { font-weight: 700; color: var(--brand); white-space: nowrap; min-width: 88px; text-align: right; }
.cart-remove-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; padding: 4px; }
.cart-remove-btn:hover { color: var(--brand); }
.cart-continue { margin-top: 20px; }

/* Tóm tắt đơn */
.cart-summary { background: var(--soft); border-radius: 12px; padding: 20px; }
.cart-summary__title { margin: 0 0 14px; font-size: 1.1rem; }
.cart-summary__row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text); }
.cart-summary__row--total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }
.cart-summary__row--total span:last-child { color: var(--brand); }

.cart-form {}
.cart-form__title { margin: 0 0 20px; }
.cart-form__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cart-form__field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.cart-input {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 15px; color: var(--text);
  background: var(--surface); font-family: inherit; width: 100%;
}
.cart-input:focus { outline: none; border-color: var(--brand); }
.cart-textarea { min-height: 80px; resize: vertical; }
.cart-captcha { margin: 16px 0; }
.cart-submit-btn { width: 100%; margin-top: 8px; }
.cart-result { margin-top: 20px; }

/* Chọn phương thức thanh toán */
.pay-method {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 14px; font-weight: 400; color: var(--text);
}
.pay-cash-box {
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--soft); padding: 14px; margin-bottom: 16px;
}
.pay-qr { max-width: 200px; width: 100%; display: block; margin: 0 auto 10px; }

/* ===== Popup thanh toán (checkout) ===== */
.checkout-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.checkout-modal[hidden] { display: none; }
.checkout-modal__box { position: relative; background: var(--surface); border-radius: 12px; padding: 24px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.checkout-modal__close { position: absolute; top: 10px; right: 14px; width: 32px; height: 32px; border: none; background: transparent; color: var(--text-muted); font-size: 26px; line-height: 1; cursor: pointer; }
.checkout-modal__title { margin: 0 0 16px; font-size: 18px; color: var(--text); }
.checkout-modal__section { margin-bottom: 16px; }
.checkout-modal__label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .3px; }
.co-items { display: flex; flex-direction: column; gap: 6px; }
.co-item { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text); }
.co-total-row { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 700; color: var(--text); }
.co-total { color: var(--brand); }
.co-shipping { margin: 0; font-size: 14px; }
.co-pay-methods { margin-bottom: 4px; }
.checkout-modal__confirm { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 18px; font-size: 14px; color: var(--text); cursor: pointer; }
.checkout-modal__confirm input { margin-top: 3px; }
.checkout-modal__actions { display: flex; gap: 10px; }
.checkout-modal__actions .btn { flex: 1; }
.checkout-modal__actions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Responsive / Mobile ===== */
@media (max-width: 640px) {
  .wrap { padding: 0 0 24px; }
  .card {
    border-radius: 0;
    padding: 16px;
    box-shadow: none;
  }
  /* Top nav gọn: ẩn link phụ, giữ logo + Đăng nhập */
  .topnav { padding: 12px 16px; }
  .topnav__brand img { height: 46px; padding: 6px; }
  .topnav__links { gap: 12px; }
  .topnav__links a[href="/"],
  .topnav__links a[href="/about"],
  .topnav__links a[href="/post"] { display: none; }

  /* Slider tràn full-width (bù padding card 16px 2 bên) */
  .slider {
    margin: -16px -16px 20px;
    width: auto;
    border-radius: 0;
    aspect-ratio: 16 / 10;
  }
  .slide { font-size: 1.15rem; padding: 0 16px; text-align: center; }

  .hero { padding: 8px 0 4px; }
  .hero__title { font-size: 1.9rem; }
  .hero__tagline { font-size: 1rem; }

  .hr { margin: 24px 0; }

  /* Stats: 3 cột đều 1 hàng (dùng grid thay flex-wrap để không lệch) */
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { min-width: 0; }
  .stat__num { font-size: 1.5rem; }
  .stat__label { font-size: 12px; }

  /* Features + steps: xếp dọc 1 cột */
  .grid, .steps { flex-direction: column; }
  .feature, .step { min-width: 0; }

  .section-title { font-size: 1.4rem; }
  .btn { width: 100%; text-align: center; padding: 14px; }
  .btn--sm { width: auto; padding: 9px 18px; }

  /* Shop mobile overrides */
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shop-card__img { height: 130px; }
  .pd { grid-template-columns: 1fr; gap: 24px; }
  .pd__gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; gap: 20px; }
  .cart-side { position: static; }
  .shop-cart-btn { width: auto; }
}

/* Order tracking (BE-render) */
.track__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.track__title { margin: 0; }
.track__status { background: var(--brand); color: var(--on-brand); padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; }
.track__date { color: var(--text-muted); margin: 4px 0 20px; }
.track__section { margin-bottom: 20px; }
.track__subtitle { font-size: 1.05rem; margin: 0 0 8px; }
.track__table { width: 100%; border-collapse: collapse; }
.track__table th { text-align: left; padding: 8px; border-bottom: 2px solid var(--border); font-size: 13px; color: var(--text-muted); }
.track__table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.track__prod { font-weight: 600; }
.track__opts { font-size: 13px; color: var(--text-secondary); }
.track__meta { font-size: 12px; color: var(--text-muted); }
.track__total { font-weight: 800; color: var(--brand); }
.track__payment { border: 1.5px solid var(--border); border-radius: 8px; background: var(--soft); padding: 14px; }
.track__pay-amount { margin: 0 0 8px; }
.track__pay-amount strong { color: var(--brand); font-size: 1.1rem; }
.track__pay-note { margin: 0 0 8px; }
.copy-code { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-code strong { font-family: monospace; font-size: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; }
.copy-code__btn { border: 1px solid var(--brand); background: transparent; color: var(--brand); border-radius: 6px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.copy-code__btn:hover { background: var(--brand); color: var(--on-brand); }
.track__continue { margin-top: 24px; }
.right { text-align: right; }
