@font-face { font-family: Mitr; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/mitr-thai-400-normal.woff2") format("woff2"); unicode-range: U+0E00-0E7F; }
@font-face { font-family: Mitr; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/mitr-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Mitr; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/mitr-thai-500-normal.woff2") format("woff2"); unicode-range: U+0E00-0E7F; }
@font-face { font-family: Mitr; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/mitr-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: Mitr; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/mitr-thai-600-normal.woff2") format("woff2"); unicode-range: U+0E00-0E7F; }
@font-face { font-family: Mitr; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/mitr-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  color-scheme: light;
  --ink: #171b24;
  --muted: #596472;
  --blue: #315b9c;
  --yellow: #f4b41b;
  --line: #dfe5eb;
  --page: #f5f7fa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Mitr, Tahoma, Arial, sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-shell main { flex: 1; }
.content-width { width: min(100% - 40px, 1260px); margin-inline: auto; }
.site-header { position: relative; z-index: 5; background: #fff; border-top: 4px solid var(--yellow); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; width: min(100% - 40px, 1260px); min-height: 74px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.brand-logo { width: 52px; height: 52px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; font-size: 20px; font-weight: 600; line-height: 1.12; white-space: nowrap; }
.brand-caption { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.header-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; color: #3d4652; font-size: 14px; font-weight: 600; white-space: nowrap; }
.header-nav a:hover, .site-footer a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.header-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.header-phone { color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.header-phone:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-contact { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 40px; padding: 0 16px; border: 1px solid #118950; border-radius: 5px; color: #0b7d46; font-size: 13px; font-weight: 600; white-space: nowrap; }
.header-contact:hover { background: #eaf8ef; }

.intro-section { background: #1b2029; color: #fff; }
.intro-inner { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-block: 24px 28px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.intro-section .eyebrow { color: var(--yellow); }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: 0; }
h1 { font-size: 31px; line-height: 1.25; }
h2 { font-size: 25px; line-height: 1.3; }
.intro-copy { max-width: 730px; margin: 8px 0 0; color: #cbd2dd; font-size: 14px; line-height: 1.6; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.contact-call, .contact-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border-radius: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.contact-call { background: var(--yellow); color: var(--ink); }
.contact-call:hover { background: #e7aa13; }
.contact-line { background: #128d50; color: #fff; }
.contact-line:hover { background: #0d7944; }
.intro-map { display: inline-block; margin-top: 12px; color: #dce7f6; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.intro-map:hover { color: #fff; }
.catalog-total { flex: none; color: #d8e0ea; font-size: 14px; font-weight: 700; white-space: nowrap; }

.weekly-section { padding: 30px 0 34px; background: #eaf0f6; border-bottom: 1px solid #dce4ed; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.rail-controls { display: flex; align-items: center; gap: 7px; }
.rail-controls button { width: 37px; height: 37px; border: 1px solid #cbd5e0; border-radius: 5px; background: #fff; color: var(--ink); font-family: Arial, sans-serif; font-size: 29px; line-height: 1; }
.rail-controls button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.rail-controls button:disabled { cursor: default; opacity: .36; }
.weekly-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 48px) / 4); gap: 16px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-color: #aebccc transparent; scrollbar-width: thin; padding-bottom: 7px; }
.weekly-rail .product-card { scroll-snap-align: start; }
.weekly-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-top: 1px solid #d7e0ea; color: var(--muted); font-size: 14px; }
.weekly-empty a { color: var(--blue); font-weight: 700; white-space: nowrap; }

.catalog-section { padding-block: 42px 72px; }
.catalog-heading { margin-bottom: 18px; }
.catalog-tools { display: flex; flex-direction: column; gap: 15px; }
.search-field { display: flex; flex-direction: column; gap: 6px; width: min(100%, 650px); min-width: 0; }
.field-label { color: #414a57; font-size: 12px; font-weight: 700; }
.search-control { display: flex; align-items: center; min-width: 0; height: 48px; padding: 0 11px; border: 1px solid #cbd4de; border-radius: 5px; background: #fff; }
.search-control:focus-within { border-color: var(--blue); }
.search-control input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-control button { flex: none; width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.category-strip { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.category-buttons { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 6px; scrollbar-color: #aebccc transparent; scrollbar-width: thin; }
.category-button { flex: none; min-height: 38px; padding: 0 15px; border: 1px solid #cbd4de; border-radius: 999px; background: #fff; color: #344052; font-size: 13px; font-weight: 500; white-space: nowrap; }
.category-button:hover:not(.active) { border-color: var(--blue); color: var(--blue); }
.category-button.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.category-button-sold-out { border-color: #66727e; color: #272d36; }
.category-button-sold-out.active { border-color: #272d36; background: #272d36; }
.results-line { margin: 22px 0 12px; color: var(--muted); font-size: 13px; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.product-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-align: left; transition: border-color .15s, box-shadow .15s; }
.product-card:hover, .product-card:focus-visible { border-color: #aab9cb; box-shadow: 0 6px 18px #17243916; }
.product-image-wrap { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; padding: 9px; border-bottom: 1px solid #e9edf0; background: #fff; }
.featured-card .product-image-wrap { aspect-ratio: 5 / 4; }
.product-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-missing { color: #7c8590; font-size: 13px; }
.product-badge { position: absolute; top: 10px; left: 10px; padding: 5px 9px; border-radius: 4px; font-size: 12px; font-weight: 800; line-height: 1.2; }
.badge-new { background: var(--yellow); color: #161a22; }
.badge-sold-out { background: #272d36; color: #fff; }
.sold-out-card .product-image { opacity: .65; filter: saturate(.75); }
.product-body { display: flex; flex-direction: column; width: 100%; min-height: 142px; padding: 13px 14px 14px; }
.featured-card .product-body { min-height: 138px; }
.product-category { color: var(--blue); font-size: 12px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.product-name { display: -webkit-box; overflow: hidden; margin-top: 7px; font-size: 15px; font-weight: 700; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.product-sku { margin-top: 5px; color: #66727e; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.product-action { margin-top: auto; padding-top: 11px; color: var(--blue); font-size: 13px; font-weight: 800; }
.sold-out-card .product-action { color: #596472; }
.more-button { display: block; min-width: 176px; min-height: 44px; margin: 28px auto 0; padding: 0 20px; border: 1px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; }
.more-button:hover { background: var(--yellow); border-color: var(--yellow); }
.empty-state { padding: 60px 12px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; color: var(--muted); font-size: 13px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--blue); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: #0d1422b8; }
.product-dialog { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(270px, .95fr); width: min(100%, 870px); max-height: min(92vh, 800px); overflow: auto; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px #0004; }
.dialog-close { position: absolute; top: 11px; right: 11px; z-index: 1; width: 38px; height: 38px; border: 1px solid #cfd7e0; border-radius: 5px; background: #fff; color: var(--ink); font-size: 24px; line-height: 1; }
.dialog-photo { display: grid; place-items: center; min-height: 410px; padding: 24px; background: #fff; }
.dialog-photo img { width: 100%; max-height: 600px; object-fit: contain; }
.dialog-details { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: 52px 30px; background: #f2f5f8; }
.dialog-category { color: var(--blue); font-size: 13px; font-weight: 800; }
.dialog-details h2 { margin: 12px 0 8px; font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.dialog-details p { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.dialog-details .dialog-stock { margin-top: 14px; padding: 5px 9px; border-radius: 4px; background: #272d36; color: #fff; font-weight: 800; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; width: 100%; margin-top: 28px; }
.dialog-call, .dialog-inquiry { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px; border-radius: 5px; font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; }
.dialog-call { border: 1px solid #b9c4d0; background: #fff; color: var(--ink); }
.dialog-call:hover { border-color: var(--ink); }
.dialog-inquiry { background: #128d50; color: #fff; }
.dialog-inquiry:hover { background: #0d7944; }

@media (max-width: 950px) {
  .weekly-rail { grid-auto-columns: calc((100% - 32px) / 3); }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .content-width, .header-inner { width: min(100% - 28px, 1260px); }
  .header-inner { min-height: 64px; gap: 10px; }
  .brand-logo { width: 46px; height: 46px; }
  .brand-name { font-size: 16px; }
  .brand-caption { font-size: 10px; }
  .header-nav { display: none; }
  .header-actions { margin-left: auto; }
  .header-phone { display: none; }
  .header-contact { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .intro-inner { align-items: flex-start; padding-block: 20px 22px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .intro-copy { font-size: 13px; }
  .intro-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .contact-call, .contact-line { padding: 0 9px; font-size: 12px; }
  .catalog-total { display: none; }
  .weekly-section { padding-block: 23px 25px; }
  .section-heading { margin-bottom: 15px; }
  .section-note { font-size: 12px; }
  .rail-controls { display: none; }
  .weekly-rail { grid-auto-columns: minmax(260px, 85%); gap: 10px; }
  .featured-card { flex-direction: row; min-height: 156px; }
  .featured-card .product-image-wrap { width: 44%; height: 156px; aspect-ratio: auto; border-right: 1px solid #e9edf0; border-bottom: 0; }
  .featured-card .product-body { width: 56%; min-height: 156px; padding: 12px; }
  .weekly-empty { align-items: flex-start; flex-direction: column; gap: 7px; padding-block: 14px; }
  .catalog-section { padding-block: 30px 48px; }
  .catalog-tools { gap: 12px; }
  .search-control input { font-size: 16px; }
  .category-buttons { margin-right: -14px; padding-right: 14px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .product-image-wrap { padding: 5px; }
  .product-body { min-height: 143px; padding: 10px; }
  .product-name { font-size: 14px; }
  .product-badge { top: 7px; left: 7px; padding: 4px 7px; font-size: 11px; }
  .results-line { margin-top: 17px; }
  .product-dialog { display: block; max-height: 94vh; }
  .dialog-photo { height: min(54vh, 380px); min-height: 0; padding: 16px; }
  .dialog-details { padding: 22px 18px 26px; }
  .dialog-details h2 { font-size: 21px; }
  .dialog-actions { flex-direction: column; margin-top: 22px; }
  .dialog-call, .dialog-inquiry { width: 100%; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 360px) {
  .brand-name { font-size: 14px; }
  .brand-logo { width: 42px; height: 42px; }
  .header-contact { padding: 0 8px; font-size: 11px; }
  .contact-call, .contact-line { font-size: 11px; }
  .weekly-rail { grid-auto-columns: minmax(252px, 88%); }
  .product-body { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card { transition: none; }
}
