:root {
  --primary: #9a0f14;
  --primary-strong: #7e070b;
  --primary-soft: #bd2c29;
  --surface: #fff8f7;
  --surface-low: #fff0ef;
  --surface-high: #fee2df;
  --surface-highest: #f8dcda;
  --text: #261817;
  --muted: #5a403e;
  --outline: #e2beba;
  --outline-strong: #8e706d;
  --white: #ffffff;
  --accent-blue: #005274;
  --accent-green: #2d6d4a;
  --shadow: 0 16px 50px rgba(65, 0, 2, 0.12);
  --radius: 8px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.admin-body {
  background: #f7eeed;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

main {
  min-height: 60vh;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  min-height: 88px;
  padding: 8px clamp(16px, 4vw, 32px);
  background: rgba(255, 248, 247, 0.92);
  border-bottom: 1px solid rgba(226, 190, 186, 0.7);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.brand img {
  width: auto;
  height: 76px;
  object-fit: contain;
}

.brand span {
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  flex: 1 1 auto;
}

.main-nav a,
.header-cta,
.btn,
.btn-outline,
.footer-links h2,
.eyebrow,
.product-badge,
.admin-sidebar a,
.admin-topbar span,
.form-actions button {
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.main-nav a {
  position: relative;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease;
}

.main-nav a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--primary);
  content: "";
  opacity: 0;
  transform: scaleX(0.6);
  transition: 160ms ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--primary);
}

.main-nav a.is-active::after,
.main-nav a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  color: var(--white);
  cursor: pointer;
  font-size: 13px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.header-cta:hover,
.btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-soft);
  box-shadow: 0 0 18px rgba(154, 15, 20, 0.2);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  transition: 160ms ease;
}

.btn-outline:hover {
  color: var(--white);
  background: var(--primary);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: var(--surface-low);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--primary);
}

.setup-notice {
  margin: 16px auto 0;
  width: min(var(--container), calc(100% - 32px));
  padding: 14px 16px;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: #fff7d6;
  color: #463600;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 88px);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--hero-image, url("../images/placeholder.svg")) center / cover no-repeat;
  content: "";
  opacity: 0.76;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 248, 247, 0.96) 0%, rgba(255, 248, 247, 0.8) 45%, rgba(255, 248, 247, 0.1) 100%), linear-gradient(0deg, var(--surface) 0%, rgba(255, 248, 247, 0) 28%);
  content: "";
}

.hero-content {
  width: min(680px, calc(100% - 32px));
  margin-left: max(16px, calc((100vw - var(--container)) / 2));
  padding: 72px 0 96px;
}

.hero h1,
.section-title,
.page-title h1,
.product-card h2,
.technology-card h2,
.feature-card h2,
.quote-section blockquote,
.detail-title,
.admin-topbar h1 {
  margin: 0;
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 680px;
  font-size: 4.8rem;
  line-height: 0.95;
}

.hero p {
  max-width: 560px;
  margin: 26px 0 34px;
  padding-left: 18px;
  border-left: 2px solid var(--primary);
  color: var(--muted);
  font-size: 1.08rem;
}

.section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.section-muted {
  background: var(--surface-low);
  border-top: 1px solid rgba(226, 190, 186, 0.7);
  border-bottom: 1px solid rgba(226, 190, 186, 0.7);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(226, 190, 186, 0.9);
}

.section-title {
  font-size: 3rem;
  line-height: 1;
}

.section-link {
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
  font-weight: 600;
  white-space: nowrap;
}

.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.product-card,
.technology-card,
.buy-card,
.contact-card,
.info-card {
  border: 1px solid rgba(226, 190, 186, 0.85);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(65, 0, 2, 0.05);
}

.feature-card {
  min-height: 190px;
  padding: 24px;
  transition: border-color 160ms ease, transform 160ms ease;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 42px;
  line-height: 1;
  color: var(--primary);
  font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 40;
}

.feature-card h2,
.product-card h2,
.technology-card h2 {
  margin-top: 12px;
  font-size: 1.45rem;
  line-height: 1.12;
}

.feature-card p,
.technology-card p,
.product-card p,
.buy-card p,
.info-card p {
  color: var(--muted);
}

.product-card,
.technology-card {
  overflow: hidden;
  background: var(--surface-highest);
  transition: border-color 160ms ease, transform 160ms ease;
}

.product-card:hover,
.technology-card:hover,
.buy-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.product-media,
.technology-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-highest);
}

.technology-media {
  aspect-ratio: 16 / 10;
}

.product-media img,
.technology-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 380ms ease;
}

.product-card:hover img,
.technology-card:hover img {
  transform: scale(1.04);
}

.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font-size: 11px;
}

.product-body,
.technology-body,
.buy-card,
.contact-card,
.info-card {
  padding: 22px;
}

.price {
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
}

.quote-section {
  text-align: center;
}

.quote-section blockquote {
  max-width: 830px;
  margin: 14px auto 18px;
  font-size: 3rem;
  line-height: 1.08;
}

.quote-section cite {
  color: var(--muted);
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
  font-weight: 600;
  text-transform: uppercase;
}

.page-title {
  padding: 58px 0 34px;
  background: var(--surface-low);
  border-bottom: 1px solid var(--outline);
}

.page-title h1 {
  font-size: 4rem;
  line-height: 1;
}

.page-title p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.filters {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.filters select,
.field input,
.field textarea,
.field select,
.newsletter-form input,
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--outline);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.filters select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.newsletter-form input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(154, 15, 20, 0.1);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 36px;
  align-items: start;
}

.detail-gallery {
  display: grid;
  gap: 12px;
}

.detail-gallery img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--surface-highest);
  object-fit: cover;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-thumbs img {
  aspect-ratio: 1 / 1;
}

.detail-title {
  margin-bottom: 12px;
  font-size: 3.6rem;
  line-height: 1;
}

.detail-copy {
  color: var(--muted);
  font-size: 1.04rem;
}

.content {
  color: var(--muted);
}

.content h2,
.content h3 {
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: 24px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label,
.field label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 600;
}

.map-frame {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-highest);
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  background: var(--surface-highest);
  object-fit: cover;
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--outline);
}

.alert-success {
  background: #edf8f0;
  color: #215d36;
  border-color: #b9dec4;
}

.alert-error {
  background: #ffe9e7;
  color: #93000a;
  border-color: #ffb4ac;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 0.9fr) auto;
  gap: 28px;
  padding: 44px clamp(16px, 4vw, 32px);
  background: var(--surface-high);
  border-top: 1px solid var(--outline);
}

.footer-news strong {
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-size: 1.7rem;
  font-style: italic;
  font-weight: 700;
}

.footer-news p {
  max-width: 420px;
  color: var(--muted);
}

.newsletter-form {
  display: flex;
  max-width: 420px;
}

.newsletter-form input {
  border-radius: 4px 0 0 4px;
}

.newsletter-form button {
  border: 1px solid var(--primary);
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  color: var(--white);
  padding: 0 16px;
  cursor: pointer;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 22px;
}

.footer-links h2 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
}

.footer-links a {
  display: block;
  margin: 6px 0;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.copyright {
  align-self: end;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--outline-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 22px 18px;
  background: var(--text);
  color: var(--surface);
  overflow-y: auto;
}

.admin-brand {
  display: block;
  margin-bottom: 22px;
  color: var(--surface);
  font-family: "Kanit", Arial, sans-serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 700;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar a {
  display: block;
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--surface-high);
  font-size: 13px;
}

.admin-sidebar a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.admin-logout {
  margin-top: 18px;
  background: rgba(154, 15, 20, 0.5);
}

.admin-main {
  width: calc(100% - 250px);
  margin-left: 250px;
  padding: 24px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.admin-topbar span {
  color: var(--muted);
  font-size: 12px;
}

.admin-topbar h1 {
  font-size: 2.7rem;
}

.admin-panel {
  margin-bottom: 22px;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 30px rgba(38, 24, 23, 0.06);
}

.admin-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--outline);
}

.admin-panel > header h2 {
  margin: 0;
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-size: 1.25rem;
  font-style: italic;
}

.admin-panel-body {
  padding: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric {
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.metric strong {
  display: block;
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-size: 2rem;
  font-style: italic;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form .span-2 {
  grid-column: 1 / -1;
}

.field small {
  color: var(--muted);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--outline);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-style: italic;
  font-weight: 700;
  white-space: nowrap;
}

.admin-table img {
  width: 72px;
  height: 54px;
  border-radius: 4px;
  object-fit: cover;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-high) 100%);
}

.login-card {
  width: min(430px, 100%);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--white);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
  color: var(--primary);
  font-family: "Kanit", Arial, sans-serif;
  font-size: 2rem;
  font-style: italic;
  text-transform: uppercase;
}

.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

@media (max-width: 980px) {
  .site-header {
    min-height: 76px;
  }

  .brand img {
    height: 58px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    display: none;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: grid;
  }

  .main-nav a {
    padding: 10px;
  }

  .main-nav a::after {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .section-title,
  .quote-section blockquote {
    font-size: 2.4rem;
  }

  .page-title h1 {
    font-size: 3rem;
  }

  .detail-title {
    font-size: 2.8rem;
  }

  .admin-topbar h1 {
    font-size: 2.2rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3,
  .grid-2,
  .detail-layout,
  .contact-layout,
  .site-footer,
  .admin-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .site-footer {
    gap: 22px;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar {
    position: static;
    width: auto;
  }

  .admin-main {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container), calc(100% - 24px));
  }

  .site-header {
    padding-inline: 12px;
  }

  .hero-content {
    width: calc(100% - 24px);
    margin-left: 12px;
    padding-bottom: 72px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .section-title,
  .quote-section blockquote {
    font-size: 2rem;
  }

  .page-title h1,
  .detail-title {
    font-size: 2.25rem;
  }

  .admin-topbar h1 {
    font-size: 1.8rem;
  }

  .section-head,
  .filters,
  .admin-topbar,
  .admin-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-4,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter-form {
    display: grid;
  }

  .newsletter-form input,
  .newsletter-form button {
    border-radius: 4px;
  }

  .admin-main {
    padding: 14px;
  }
}
