:root {
  --ink: #163a32;
  --ink-soft: #31574d;
  --paper: #fbfaf6;
  --paper-deep: #f0eee5;
  --line: #dcd9ce;
  --sand: #e9dfcd;
  --coral: #b85442;
  --coral-deep: #963e30;
  --white: #ffffff;
  --shell: 1160px;
  --shadow: 0 14px 30px rgba(22, 58, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Nunito Sans", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.96);
}

.header-inner {
  display: grid;
  min-height: 72px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.wordmark {
  font-family: "Rubik", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--coral-deep);
}

.bag-trigger {
  min-height: 44px;
  justify-self: end;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease;
}

.bag-trigger:hover,
.bag-trigger:focus-visible {
  color: var(--white);
  background: var(--ink);
}

.bag-trigger span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  margin-left: 6px;
  border-radius: 50%;
  color: var(--white);
  background: var(--coral);
  font-size: 12px;
}

.hero {
  padding-top: 48px;
  background: var(--paper-deep);
}

.hero-copy {
  max-width: 680px;
  padding-bottom: 28px;
}

.eyebrow,
.product-type {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--coral-deep);
}

h1,
h2,
h3 {
  font-family: "Rubik", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
  line-height: 1.1;
}

h1 {
  max-width: 680px;
  margin-top: 8px;
  font-size: 46px;
  font-weight: 800;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin-top: 12px;
  color: #49635b;
  font-size: 17px;
}

.hero-carousel {
  width: min(1440px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: var(--sand);
}

.hero-carousel-target {
  display: grid;
  width: 100%;
  height: 288px;
  padding: 0;
  border: 0;
  background: var(--sand);
}

.hero-slide {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 240ms ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-carousel-target:active .hero-slide.is-active {
  opacity: 0.9;
}

.goods {
  padding: 56px 0 64px;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 24px;
}

h2 {
  font-size: 32px;
  font-weight: 800;
}

.section-heading div > p,
.about-layout div > p {
  max-width: 600px;
  margin-top: 14px;
  color: #52645d;
  font-size: 17px;
}

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

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
}

.product-card > img {
  width: 100%;
  height: 218px;
  object-fit: cover;
  background: var(--sand);
}

.product-copy {
  display: flex;
  min-height: 180px;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.product-type {
  color: var(--coral-deep);
}

h3 {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 750;
}

.product-copy > p:not(.product-type) {
  margin-top: 8px;
  color: #52645d;
  font-size: 14px;
}

.product-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
}

.product-action strong,
.cart-total strong,
.payment-summary strong {
  font-family: "Rubik", "Noto Sans SC", sans-serif;
  font-size: 20px;
}

.secondary-button,
.primary-button,
.text-button,
.close-button {
  border: 0;
  font-weight: 800;
}

.secondary-button,
.primary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.secondary-button {
  color: var(--ink);
  background: var(--sand);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--white);
  background: var(--ink);
}

.primary-button {
  width: 100%;
  color: var(--white);
  background: var(--coral);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--coral-deep);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.shop-status {
  min-height: 26px;
  margin-top: 22px;
  color: #52645d;
  font-size: 14px;
}

.about {
  padding: 54px 0;
  border-top: 1px solid var(--line);
  background: #f4f2eb;
}

.about-layout {
  max-width: 680px;
}

.site-footer {
  padding: 24px 0;
  color: #dce4df;
  background: var(--ink);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-footer a {
  color: var(--white);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.shop-dialog {
  width: min(580px, calc(100% - 32px));
  max-height: min(720px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(13, 32, 27, 0.24);
}

.shop-dialog::backdrop {
  background: rgba(10, 25, 21, 0.58);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin-top: 5px;
  font-size: 28px;
}

.close-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper-deep);
  font-size: 28px;
  line-height: 1;
}

.close-button:hover,
.close-button:focus-visible {
  color: var(--white);
  background: var(--ink);
}

.dialog-body {
  padding: 24px;
}

.dialog-body > p {
  color: #52645d;
}

.empty-cart {
  padding: 18px;
  border: 1px dashed #bdb9ad;
  background: var(--white);
}

.cart-lines {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line h3 {
  margin: 0;
  font-size: 17px;
}

.cart-line p {
  margin-top: 4px;
  color: #52645d;
  font-size: 14px;
}

.cart-line-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 4px;
}

.text-button {
  min-height: 32px;
  padding: 0;
  color: var(--coral-deep);
  background: transparent;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.cart-total,
.payment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.cart-total {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.payment-summary {
  margin: 24px 0;
  padding: 18px;
  background: var(--paper-deep);
}

.payment-message {
  margin-top: 16px;
  padding: 14px;
  border-left: 3px solid var(--coral);
  color: var(--coral-deep) !important;
  background: #fff2ed;
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero {
    padding-top: 40px;
  }

  .hero-copy {
    padding-bottom: 24px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-carousel-target {
    height: 250px;
  }

  .product-card > img {
    height: 210px;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(var(--shell), calc(100% - 32px));
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
  }

  .bag-trigger {
    padding: 0 10px;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    font-size: 34px;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 17px;
  }

  .hero-carousel-target {
    height: 220px;
  }

  .goods {
    padding: 56px 0 64px;
  }

  h2 {
    font-size: 30px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-copy {
    min-height: 172px;
  }

  .product-card > img {
    height: 228px;
  }

  .about {
    padding: 56px 0;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .dialog-header,
  .dialog-body {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}
