/* =================================================================
   Hana Café — Sammakorn
   Design system: warm, simple, Japanese-cozy.
   ================================================================= */

:root {
  --bg: #FAF6F0;
  --surface: #F3ECE1;
  --surface-2: #EFE6D8;
  --text: #3A322C;
  --text-soft: #6B5F53;
  --accent: #A9705A;
  --accent-dark: #8C5A46;
  --accent-2: #7C8B6F;
  --border: #E4D9C8;
  --white: #FFFFFF;
  --danger: #B24C3A;
  --success: #6E8F5C;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgba(58, 50, 44, 0.08);
  --shadow-sm: 0 2px 10px rgba(58, 50, 44, 0.06);

  --font-en: 'Noto Serif', 'EB Garamond', serif;
  --font-th: 'Noto Serif Thai', 'Noto Sans Thai', serif;
  --font-ja: 'Zen Maru Gothic', 'Noto Serif JP', serif;

  --content-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body[lang="th"] { font-family: var(--font-th); }
body[lang="ja"] { font-family: var(--font-ja); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--text-soft); }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }

.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-heading .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* --- Buttons ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }

.btn--outline {
  background: transparent;
  color: var(--accent-dark);
  border-color: var(--accent);
}
.btn--outline:hover { background: var(--accent); color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface); }

.btn--sm { padding: 8px 18px; font-size: 0.85rem; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #8f3a2c; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Header / Nav -------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.brand__name { letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a { color: var(--text-soft); font-size: 0.95rem; position: relative; }
.site-nav a:hover, .site-nav a.is-active { color: var(--accent-dark); text-decoration: none; }


.lang-switch { display: flex; gap: 4px; margin-left: 4px; }
.lang-switch a {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.lang-switch a.is-active { background: var(--accent); color: var(--white); border-color: var(--accent); }

a.track-order-badge, a.track-order-badge:hover, a.track-order-badge:visited {
  display: inline-flex;
  align-items: center;
  background: #A9705A;
  color: #FFFFFF !important;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
a.track-order-badge:hover { background: var(--accent-dark); }

.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-badge {
  position: absolute;
  top: -10px;
  right: -16px;
  background: var(--accent-dark);
  color: var(--white);
  font-size: 0.7rem;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

/* --- Hero ----------------------------------------------------------- */

.hero {
  padding: 48px 0 80px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(169,112,90,0.08), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(124,139,111,0.10), transparent 45%);
}
.hero .eyebrow {
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.hero h1 { margin: 12px 0 20px; }
.hero p.lead {
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 1.1rem;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.press-label {
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.press-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.press-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.press-badge svg { color: var(--accent); flex-shrink: 0; }
.press-badge:hover { background: var(--accent); color: var(--white); text-decoration: none; box-shadow: var(--shadow); }
.press-badge:hover svg { color: var(--white); }

.hero-photo {
  margin-top: 56px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16/7;
  background: var(--surface-2);
}

/* --- Cards / grids --------------------------------------------------- */

.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Featured Products (Home) + Shop listing — fixed column counts: 3 on
   desktop, 2 on tablet/iPad, 1 on phone. */
#menu .grid, .shop-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) {
  #menu .grid, .shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  #menu .grid, .shop-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.card__image {
  aspect-ratio: 4/3;
  background: var(--surface-2);
  overflow: hidden;
}
.card__image img { width: 100%; height: 100%; object-fit: cover; }

.card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card__body h3 { margin-bottom: 6px; }
.card__body p { font-size: 0.92rem; flex: 1; }
.card__meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.card__price { color: var(--accent-dark); font-weight: 600; }

/* --- Carousel mechanics (shared by announcements + reviews) ------------- */

.carousel {
  position: relative;
  overflow: hidden;
  padding: 0 56px;
}

.carousel-track {
  display: flex;
  transition: transform 0.45s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  z-index: 2;
}
.carousel-prev:hover, .carousel-next:hover { background: var(--surface); }
.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
}
.carousel-dot.is-active { background: var(--accent); }

@media (max-width: 640px) {
  .carousel { padding: 0; }
  .carousel-prev, .carousel-next { display: none; }
}

/* --- Home announcements card -------------------------------------------- */

.announce-card {
  width: 100%;
  max-width: 832px;
  height: 286px;
  display: flex;
  flex-direction: row;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: box-shadow 0.2s ease;
}
.announce-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.announce-card__image { flex: 0 0 50%; height: 100%; }
.announce-card__image img, .announce-card__image .placeholder-photo { width: 100%; height: 100%; object-fit: cover; }
.announce-card__body {
  flex: 0 0 50%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}
.announce-card__body .badge--lang { align-self: flex-start; }
.announce-card h3 { color: var(--text); font-size: 1.05rem; margin: 0; }
.announce-card p { color: var(--text-soft); font-size: 0.88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 640px) {
  .announce-card { height: auto; flex-direction: column; }
  .announce-card__image { flex: 0 0 auto; height: 182px; }
  .announce-card__body { flex: 1 1 auto; padding: 14px; }
}

.placeholder-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 12px, var(--surface) 12px, var(--surface) 24px);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}

/* --- Gallery ---------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.gallery > div:nth-child(-n+2) { grid-column: span 3; aspect-ratio: 4/3; }
.gallery > div:nth-child(n+3) { grid-column: span 2; aspect-ratio: 4/3; }
.gallery > div { border-radius: var(--radius); overflow: hidden; }

/* --- Google reviews ----------------------------------------------------- */

.review-card {
  width: 100%;
  max-width: 560px;
  min-height: 180px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.review-card__stars { color: #e2a93a; font-size: 0.95rem; letter-spacing: 2px; }
.review-card p { color: var(--text); font-size: 0.92rem; margin: 0; flex: 1; }
.review-card__author { font-size: 0.82rem; color: var(--text-soft); }
.reviews-summary { display: flex; align-items: center; gap: 10px; margin-top: -8px; margin-bottom: 24px; }
.reviews-summary strong { font-size: 1.4rem; color: var(--text); }
.reviews-summary .review-card__stars { font-size: 1.1rem; }

/* --- Hours / location split ------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-soft);
}
.info-list li > span:first-child { color: var(--text); display: flex; align-items: center; gap: 8px; }
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  flex: 0 0 auto;
}
.site-footer__block .icon-badge { width: 22px; height: 22px; }
.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; }

/* --- Forms ------------------------------------------------------------- */

.form-field { margin-bottom: 20px; }
.form-field label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="password"],
.form-field input[type="file"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(169,112,90,0.15);
}
.radio-row { display: flex; gap: 20px; }
.radio-row label { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--text); }

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.alert--error { background: #FBEAE6; color: var(--danger); border: 1px solid #F0CFC7; }
.alert--success { background: #EEF3EA; color: var(--success); border: 1px solid #D6E3CD; }

/* --- Cart / checkout tables --------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); }
.table .qty-input { width: 64px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; text-align: center; }

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  color: var(--text-soft);
}
.summary-row.total { color: var(--text); font-weight: 600; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 6px; }

/* --- Payment / QR --------------------------------------------------------- */

.qr-box {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.qr-box img { margin: 0 auto 16px; border-radius: var(--radius-sm); }
.qr-amount { font-size: 1.6rem; font-weight: 600; color: var(--accent-dark); margin-bottom: 4px; }

/* --- Badges ---------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  background: var(--surface-2);
  color: var(--text-soft);
}
.badge--pending { background: #F5E9D6; color: #8A6415; }
.badge--paid { background: #E4EEDD; color: var(--success); }
.badge--fulfilled { background: #DEE7F0; color: #3D5C7A; }
.badge--cancelled { background: #F5DEDA; color: var(--danger); }
.badge--sold-out { background: #B24C3A; color: #FFFFFF; }
.badge--lang { background: var(--accent); color: var(--white); }

/* --- Blog ------------------------------------------------------------------ */

.post-article { max-width: 720px; margin: 0 auto; }
.post-article .post-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; aspect-ratio: 16/9; }
.post-article .post-meta { color: var(--text-soft); font-size: 0.85rem; margin-bottom: 24px; }
.post-article .post-content { font-size: 1.05rem; }
.post-article .post-content p { color: var(--text); }

/* --- Footer ----------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 56px 24px 32px;
}
.site-footer__block h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); margin-bottom: 12px; }
.site-footer__block p { font-size: 0.9rem; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { display: flex; align-items: center; gap: 8px; color: var(--text-soft); }
.footer-links a:hover { color: var(--accent-dark); }
.site-footer__legal {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: center;
}

/* =================================================================
   Admin (utilitarian, not part of the public design system)
   ================================================================= */

.admin-body { background: #EFEAE2; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: #2E2822;
  color: #E9E1D6;
  padding: 24px 16px;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: #cfc4b6;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.is-active { background: #453D33; color: #fff; text-decoration: none; }
.admin-sidebar .brand__name { color: #fff; }
.admin-main { flex: 1; padding: 32px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.admin-table th { background: #F5F0E8; font-size: 0.78rem; text-transform: uppercase; color: var(--text-soft); }
.admin-actions { display: flex; gap: 8px; }
.admin-login-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); }
.admin-login-card { width: 360px; }
.thumb-sm { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }

/* --- Responsive ---------------------------------------------------------------- */

@media (max-width: 860px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 16px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery > div { grid-column: span 1 !important; aspect-ratio: 4/3 !important; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  /* Intentionally not inverted: the warm paper palette is the brand look
     in both system themes, matching the cafe's real-world signage. */
}
