/* =====================================================
   4-layout.css — Bố cục trang công khai
   Quy tắc:
   - .container là khung chung: tối đa --content-width, căn giữa.
   - Hero, thanh tìm kiếm, lưới thẻ và trang chi tiết chỉ khai báo ở đây.
   - Breakpoint: 900px (gallery 3 cột), 760px (1 cột),
     600px (thu gọn chữ, nút tối thiểu 44px cho chạm).
   ===================================================== */

.container {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  padding: 28px 24px 56px;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 320px;
  padding: 48px 24px 64px;
  color: #fff;
  background:
    linear-gradient(125deg, rgba(5, 25, 50, .92), rgba(11, 53, 92, .78) 58%, rgba(21, 101, 192, .62)),
    radial-gradient(circle at 82% 22%, rgba(34, 211, 238, .34), transparent 30%),
    url("../images/bg.jpg") center / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 56px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  min-height: 220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}
.hero-copy { max-width: 820px; }
.hero .eyebrow {
  position: relative;
  display: block;
  margin-bottom: var(--space-4);
  padding-left: 14px;
  font-size: .9rem;
  font-weight: var(--fw-semibold);
  letter-spacing: .09em;
  line-height: 1.55;
  text-transform: uppercase;
  color: #a5f3fc;
}
.hero .eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, .7);
}
.hero h1 {
  max-width: 820px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .28);
}
.hero h1 .hero-village { color: #67e8f9; }
.hero p {
  max-width: 660px;
  margin: 0;
  font-size: .96rem;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.hero .stats { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; }
.hero .stats div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  font-size: .84rem;
  background: rgba(5, 24, 48, .5);
  border: 1px solid rgba(165, 243, 252, .38);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
}
.hero .stats b {
  display: inline-block;
  min-width: 48px;
  font-family: var(--font-head);
  font-size: 1.8rem;
  line-height: 1;
  color: #67e8f9;
}
.hero .stats span { font-weight: var(--fw-medium); color: rgba(255, 255, 255, .9); }
.hero .stats.shops-only { max-width: 220px; }

/* ----- Thanh công cụ và tìm kiếm ----- */
.toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: -8px 0 28px;
}
.search-wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue-2);
  border-radius: 50%;
  transform: translateY(-50%);
}
.search-wrap::after {
  content: "";
  position: absolute;
  left: 32px;
  top: 60%;
  width: 7px;
  height: 2px;
  background: var(--blue-2);
  transform: rotate(45deg);
}
.search-wrap input[type="search"] {
  height: 52px;
  padding-left: 46px;
  box-shadow: var(--shadow);
}

/* ----- Trang chi tiết cửa hàng ----- */
.article {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 12px auto 18px;
  padding: clamp(16px, 2vw, 28px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
}
.shop-title { width: 100%; margin: 0 0 14px; }
.post-head h1 {
  margin: 6px 0 4px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.2;
}
.post-head .tag { margin-bottom: 0; }
.post-meta { margin: 0; font-size: .84rem; color: var(--muted); }

.shop-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.shop-overview-main,
.shop-overview-details { min-width: 0; }
.shop-overview-details { display: flex; flex-direction: column; }

.post-cover { margin: 10px 0 0; }
.post-cover img,
.post-cover .ph {
  width: 100%;
  height: auto;
  min-height: 220px;
  max-height: 320px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-control);
}
.post-cover .ph > span { font-size: 4rem; }
.primary-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  cursor: zoom-in;
}
.post-lead { margin: 0; font-size: .96rem; line-height: 1.5; color: var(--ink); }

.post-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
}
.post-info > div { min-width: 0; overflow-wrap: anywhere; }
.post-info > div span {
  display: block;
  margin-bottom: 2px;
  font-size: .74rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.post-info p { margin: 0; font-size: .88rem; }

.post-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 10px; }
.post-actions .btn { flex: 1 1 150px; justify-content: center; }

.shop-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: 18px;
}
.shop-section {
  min-width: 0;
  padding: var(--space-3);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.shop-section h2 { margin: 0 0 var(--space-2); font-size: 1rem; }
.post-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  cursor: zoom-in;
}
.gallery-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .2s ease;
}
.gallery-thumb:hover img { transform: scale(1.04); }
.gallery-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 70px;
  margin: 0;
  color: var(--muted);
}
.post-map {
  display: block;
  width: 100%;
  height: 440px;
  border: 0;
  border-radius: var(--radius-control);
}
.map-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 0;
  text-align: center;
  color: var(--muted);
}

/* ----- Lưới cửa hàng ----- */
.section-title { margin-top: var(--space-2); }

/* ----- Chân trang ----- */
.footer {
  margin-top: var(--space-5);
  padding: 28px 20px 40px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { font-weight: var(--fw-semibold); color: var(--blue); }

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .post-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { min-height: 0; padding: 36px 18px 54px; }
  .hero-inner { grid-template-columns: 1fr; gap: 16px; min-height: 0; max-width: 680px; }
  .hero .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
  .hero .stats div { min-height: 64px; padding: 10px 12px; }
  .hero .stats.shops-only { grid-template-columns: 1fr; }
  .shop-overview { grid-template-columns: 1fr; gap: var(--space-5); }
  .post-cover img,
  .post-cover .ph { min-height: 0; }
}
@media (max-width: 600px) {
  .container { padding: 20px 14px 32px; }
  .hero { padding: 24px 16px 22px; }
  .hero::after { display: none; }
  .hero-inner { gap: 12px; }
  .hero .eyebrow { margin-bottom: 10px; font-size: .74rem; line-height: 1.4; letter-spacing: .05em; }
  .hero h1 { margin-bottom: 10px; font-size: clamp(1.6rem, 8vw, 2.25rem); line-height: 1.04; overflow-wrap: anywhere; }
  .hero p { font-size: .86rem; line-height: 1.45; }
  .hero .stats { gap: 8px; }
  .hero .stats div { min-height: 56px; gap: 8px; padding: 8px; font-size: .75rem; }
  .hero .stats b { min-width: 36px; font-size: 1.4rem; }
  .hero .stats.shops-only { max-width: 200px; }
  .toolbar { gap: 12px; margin-bottom: 22px; }
  .search-wrap { max-width: none; }
  .section-title { flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); }
  .section-title h2 { font-size: 1.15rem; }
  .section-title span { font-size: .85rem; }
  .grid { gap: 14px; }
  .card .media img,
  .card .ph { height: 165px; }
  .card .body { padding: 14px; }
  .footer { padding: 22px 14px 28px; }

  .article { width: auto; margin: 8px; padding: 12px 10px 16px; border-radius: var(--radius-soft); }
  .shop-title { margin-bottom: 10px; }
  .shop-overview { gap: 12px; }
  .post-head h1 { font-size: clamp(1.3rem, 6vw, 1.65rem); overflow-wrap: anywhere; }
  .post-cover img,
  .post-cover .ph { aspect-ratio: 4 / 3; max-height: 220px; }
  .post-lead { font-size: .9rem; }
  .post-info { grid-template-columns: 1fr; gap: var(--space-2); margin-top: 10px; padding: 10px; }
  .post-actions { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .post-actions .btn { width: 100%; }
  .shop-sections { gap: var(--space-2); margin-top: 14px; }
  .shop-section { padding: 10px; }
  .shop-section h2 { font-size: .92rem; }
  .post-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .post-map { height: 300px; }
  .gallery-viewer { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 4px; padding: 48px 8px 12px; }
  .gallery-nav { width: 34px; height: 34px; font-size: 1.4rem; }
  .gallery-viewer-image { max-height: calc(100vh - 150px); }
  .btn { min-height: 44px; justify-content: center; }
}