:root {
  --ivory: #f8f4ed;
  --porcelain: #fffdf9;
  --ink: #171311;
  --muted: #726a62;
  --line: #e4dbce;
  --gold: #b4975a;
  --deep-gold: #74572a;
  --sage: #687967;
  --rose: #c88982;
  --plum: #51314b;
  --shadow: 0 22px 55px rgba(23, 19, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--porcelain);
  font-family: "Noto Sans Thai", "Noto Serif SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 249, 0.95);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header[data-elevated="true"] {
  border-color: var(--line);
  box-shadow: 0 12px 34px rgba(23, 19, 17, 0.08);
}

.utility-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 20px;
  color: #fff;
  background: var(--ink);
  font-size: 0.76rem;
}

.brand-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 16px;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 5px;
}

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

.brand-name,
.admin-brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 1.75rem;
  line-height: 1;
}

.brand-lockup small,
.admin-brand small {
  color: var(--muted);
  font-size: 0.76rem;
}

.ghost-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.ghost-icon span {
  font-size: 1.5rem;
  line-height: 1;
}

.admin-entry {
  justify-self: end;
  display: inline-grid;
  justify-items: end;
  color: var(--muted);
  font-size: 0.86rem;
}

.category-nav {
  display: flex;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-pill {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.category-pill span,
.category-pill small {
  display: block;
  text-align: left;
  line-height: 1.25;
}

.category-pill small {
  color: var(--muted);
  font-size: 0.72rem;
}

.category-pill em {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--deep-gold);
  background: var(--ivory);
  font-style: normal;
  font-size: 0.76rem;
}

.category-pill.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.category-pill.is-active small {
  color: rgba(255, 255, 255, 0.76);
}

.category-pill.is-active em {
  color: var(--ink);
  background: #fff;
}

.menu-hero {
  position: relative;
  min-height: 470px;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
}

.menu-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(23, 19, 17, 0.12), rgba(23, 19, 17, 0.5)),
    linear-gradient(90deg, rgba(23, 19, 17, 0.62), rgba(23, 19, 17, 0.05));
}

.menu-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 24px 70px;
  color: #fff;
}

.hero-copy p,
.section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.featured-band h2,
.atelier-copy h2,
.admin-hero h1,
.admin-section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-weight: 500;
  line-height: 1.14;
}

.hero-copy h1 {
  max-width: 620px;
  font-size: 3.35rem;
}

.hero-copy span {
  display: block;
  max-width: 520px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
}

.menu-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  max-width: 1120px;
  margin: -35px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 3;
}

.search-box,
.select-box,
.campaign-tile,
.product-card,
.admin-section,
.stat-tile,
.admin-item,
.admin-product-row,
.product-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
}

.search-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.search-box label,
.select-box {
  color: var(--muted);
  font-size: 0.82rem;
}

.search-box strong,
.search-box span,
.select-box span {
  display: block;
}

.search-box input,
.select-box select,
.table-toolbar input,
.table-toolbar select,
.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  padding: 10px 12px;
  outline: none;
}

.search-box input:focus,
.select-box select:focus,
.table-toolbar input:focus,
.table-toolbar select:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(180, 151, 90, 0.16);
}

.select-box {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.widget-strip,
.product-section,
.featured-band,
.atelier-section,
.site-footer,
.admin-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.widget-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 34px;
}

.campaign-tile {
  padding: 22px;
}

.campaign-tile h3,
.product-card h3,
.admin-item h3,
.admin-product-row h3 {
  margin: 0;
  font-size: 1.2rem;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-weight: 500;
}

.campaign-tile span,
.featured-band span,
.section-heading span,
.atelier-copy span,
.admin-hero span,
.admin-section .section-heading span,
.product-copy > span,
.admin-item span,
.admin-product-row span {
  display: block;
  color: var(--muted);
}

.campaign-tile p:not(.section-kicker),
.product-copy p,
.admin-item p,
.admin-product-row p {
  color: var(--muted);
}

.featured-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 58px;
  padding-bottom: 30px;
}

.featured-band h2,
.section-heading h2,
.atelier-copy h2,
.admin-section h2 {
  font-size: 2rem;
}

.text-link,
.text-button {
  color: var(--deep-gold);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.product-section {
  padding-bottom: 64px;
}

.section-heading {
  max-width: 560px;
  margin-bottom: 26px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.product-image-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: var(--ivory);
  cursor: pointer;
}

.product-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card:hover .product-image-button img {
  transform: scale(1.035);
}

.product-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  display: grid;
  gap: 1px;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border-radius: 6px;
  color: #fff;
  background: rgba(23, 19, 17, 0.74);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  text-align: left;
}

.product-tag small {
  color: rgba(255, 255, 255, 0.75);
}

.product-copy {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.product-category {
  margin: 0;
  color: var(--deep-gold);
  font-size: 0.78rem;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.product-meta strong {
  font-size: 1.08rem;
}

.empty-state,
.admin-empty {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.atelier-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 36px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line);
}

.atelier-list {
  display: grid;
  gap: 12px;
}

.atelier-list div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.atelier-list span {
  color: var(--muted);
}

.floating-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  width: min(300px, calc(100% - 48px));
  padding: 18px;
  border: 1px solid rgba(180, 151, 90, 0.42);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--plum), var(--ink));
  box-shadow: var(--shadow);
}

.floating-widget strong,
.floating-widget span {
  display: block;
}

.floating-widget span {
  color: rgba(255, 255, 255, 0.78);
}

.floating-widget .text-button {
  margin-top: 12px;
  color: #f1ddac;
}

.floating-close,
.dialog-close {
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.floating-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 26px;
  height: 26px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.product-dialog {
  width: min(940px, calc(100% - 30px));
  max-height: calc(100% - 34px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--porcelain);
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(23, 19, 17, 0.56);
}

.dialog-close {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
}

.dialog-layout {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  min-height: 560px;
}

.dialog-layout > img {
  width: 100%;
  height: 100%;
  min-height: 560px;
  object-fit: cover;
}

.dialog-copy {
  padding: 44px;
  overflow: auto;
}

.dialog-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 2rem;
  font-weight: 500;
}

.dialog-copy > span {
  display: block;
  color: var(--muted);
}

.dialog-price {
  margin: 18px 0;
  color: var(--deep-gold);
  font-size: 1.5rem;
  font-weight: 700;
}

.dialog-copy dl {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.dialog-copy dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.dialog-copy dt {
  color: var(--deep-gold);
  font-weight: 700;
}

.dialog-copy dd {
  margin: 0;
  color: var(--muted);
}

.dialog-actions,
.form-actions,
.admin-actions,
.row-actions,
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-button {
  color: #fff;
  background: var(--ink);
}

.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.danger-button {
  color: #fff;
  background: #8f2d32;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 32px;
  padding-bottom: 42px;
  border-top: 1px solid var(--line);
}

.site-footer img {
  width: 58px;
  height: 50px;
  object-fit: contain;
}

.site-footer span,
.site-footer strong {
  display: block;
}

.site-footer span {
  color: var(--muted);
}

.admin-body {
  background: var(--ivory);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-brand img {
  width: 56px;
  height: 48px;
  object-fit: contain;
}

.admin-header nav a {
  color: var(--deep-gold);
}

.admin-shell {
  padding-top: 28px;
  padding-bottom: 70px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 28px 0;
}

.admin-hero h1 {
  font-size: 2.45rem;
}

.import-label input {
  display: none;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-tile {
  padding: 18px;
  background: #fff;
}

.stat-tile strong,
.stat-tile span,
.stat-tile small {
  display: block;
}

.stat-tile strong {
  font-size: 1.8rem;
  color: var(--plum);
}

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

.admin-section {
  padding: 24px;
  margin-top: 18px;
  background: #fff;
}

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

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.admin-form textarea {
  resize: vertical;
}

.admin-form .check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.admin-form .check-row input {
  width: 18px;
  min-height: 18px;
}

.admin-form .upload-box {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
}

.upload-box span {
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-form label:nth-last-child(-n + 3),
.widget-form label:nth-child(4),
.widget-form label:nth-child(5),
.product-form label:nth-child(7),
.product-form label:nth-child(8),
.product-preview,
.form-actions {
  grid-column: 1 / -1;
}

.product-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.product-preview img {
  width: 84px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--ivory);
}

.product-preview strong,
.product-preview span,
.product-preview small {
  display: block;
}

.product-preview small {
  color: var(--deep-gold);
}

.admin-list,
.admin-product-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

.item-status {
  margin: 0 0 4px;
  color: #8f2d32;
  font-size: 0.78rem;
}

.item-status.is-live {
  color: var(--sage);
}

.table-toolbar {
  justify-content: space-between;
  margin-top: 22px;
}

.table-toolbar input {
  max-width: 360px;
}

.table-toolbar select {
  max-width: 230px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
}

.admin-product-row > img {
  width: 92px;
  height: 106px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--ivory);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: 320px;
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .product-grid,
  .widget-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-tools,
  .atelier-section,
  .dialog-layout,
  .admin-stats,
  .admin-product-row {
    grid-template-columns: 1fr;
  }

  .dialog-layout > img {
    min-height: 330px;
    max-height: 420px;
  }

  .admin-product-row {
    align-items: stretch;
  }

  .admin-product-row > img {
    width: 100%;
    height: 230px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .utility-bar {
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  .brand-row {
    padding: 16px;
  }

  .brand-lockup img {
    width: 62px;
    height: 54px;
  }

  .brand-name {
    font-size: 1.35rem;
  }

  .category-nav {
    padding: 0 16px 14px;
  }

  .menu-hero {
    min-height: 390px;
  }

  .hero-copy {
    padding: 42px 18px 54px;
  }

  .hero-copy h1 {
    font-size: 2.3rem;
  }

  .menu-tools {
    grid-template-columns: 1fr;
    margin-top: -24px;
    padding: 0 16px;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .widget-strip,
  .product-section,
  .featured-band,
  .atelier-section,
  .site-footer,
  .admin-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .widget-strip,
  .product-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .featured-band,
  .admin-hero,
  .admin-header,
  .admin-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header,
  .admin-hero,
  .featured-band {
    display: flex;
  }

  .dialog-copy {
    padding: 28px 20px;
  }

  .dialog-copy dl div,
  .atelier-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .floating-widget {
    right: 16px;
    bottom: 16px;
    width: calc(100% - 32px);
  }
}
