:root {
  --paper: #f8f4ec;
  --surface: #fffcf6;
  --ink: #28211d;
  --muted: #655950;
  --wine: #761e27;
  --dark-wine: #501219;
  --line: #e4dacc;
  --gold: #e4bf86;
  --serif: "Noto Serif SC", "Songti SC", "STSong", SimSun, Georgia, serif;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; background-color: var(--paper); background-size: cover; background-position: center; background-attachment: fixed; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }
h1 { font-size: clamp(2.45rem, 5vw, 4rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.28rem; }
:focus-visible { outline: 3px solid #b4834b; outline-offset: 4px; }
.wrap { width: min(1220px, calc(100% - 104px)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: 1rem; z-index: 2; background: white; padding: .6rem 1rem; transform: translateY(-200%); }
.skip:focus { transform: none; }
.masthead { background: #fcf8f0; border-bottom: 1px solid #dbcabb; }
.header-row { min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--wine); }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 28px/1.08 var(--serif); letter-spacing: .16em; }
.brand small { font-size: .66rem; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.seal { width: 43px; height: 43px; border-radius: 11px 4px 11px 4px; display: grid; place-items: center; color: #fff2dc; background: var(--wine); font: 700 24px var(--serif); }
.header-row nav { display: flex; gap: clamp(22px, 4vw, 58px); font-size: .95rem; align-self: stretch; }
.header-row nav a { display: grid; align-items: center; position: relative; white-space: nowrap; }
.header-row nav a[aria-current], .header-row nav a:hover { color: var(--wine); }
.header-row nav a[aria-current]::after { content: ""; position: absolute; bottom: 0; width: 100%; height: 2px; background: var(--wine); }
.cart-link { display: flex; align-items: center; justify-self: end; gap: 10px; border: 1px solid var(--line); border-radius: 3px; padding: 9px 13px; font-size: .9rem; white-space: nowrap; }
.cart-count { background: #eee3d7; color: var(--wine); border-radius: 50%; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: .75rem; }
.bag { display: inline-block; width: 14px; height: 13px; border: 1px solid; border-radius: 2px; position: relative; margin-top: 3px; }
.bag::before { content: ""; position: absolute; width: 6px; height: 6px; border: 1px solid; border-bottom: 0; border-radius: 5px 5px 0 0; left: 3px; top: -6px; }
.hero { position: relative; display: grid; align-items: center; isolation: isolate; min-height: clamp(450px, 42vw, 625px); background: #501015; color: #fff6df; overflow: hidden; }
.hero-image, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-image { object-fit: cover; object-position: 55% 50%; }
.hero-shade { background: linear-gradient(90deg, #2d070bd9 0%, #37080cb3 29%, #41070b24 57%, transparent 100%); }
.hero-inner { padding-block: 56px; }
.hero-copy { width: min(445px, 100%); }
.overline { display: inline-flex; align-items: center; gap: 10px; font-size: .79rem; letter-spacing: .19em; color: var(--wine); }
.overline i { width: 7px; height: 7px; display: inline-block; transform: rotate(45deg); border: 1px solid currentColor; flex: 0 0 auto; }
.hero .overline { color: var(--gold); }
.hero h1 { white-space: pre-line; font-size: clamp(3.4rem, 5.8vw, 6rem); line-height: 1.08; letter-spacing: .065em; margin: 19px 0 22px; overflow-wrap: anywhere; }
.hero p { font-size: 1rem; line-height: 1.9; color: #f3dfc7; max-width: 385px; margin-bottom: 29px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid transparent; border-radius: 3px; padding: 11px 19px; color: white; background: var(--wine); text-align: center; font-weight: 650; min-height: 44px; }
.button:hover { background: var(--dark-wine); }
.hero-button { color: #371e16; background: #f0d7ae; min-width: 184px; justify-content: space-between; }
.hero-button:hover { background: #fff0cc; }
.button.secondary { background: transparent; border-color: #c6ae9b; color: var(--wine); }
.button.secondary:hover { background: #f0e4d7; }
.full { width: 100%; }
.catalogue { padding-block: 52px 70px; scroll-margin-top: 10px; }
.section-head, .catalogue-controls { background: color-mix(in srgb, var(--surface) 96%, transparent); padding-inline: 18px; }
.section-head { display: grid; justify-items: center; gap: 8px; padding-top: 14px; }
.section-head h2 { font-size: clamp(2rem, 3.4vw, 2.9rem); letter-spacing: .075em; }
.catalogue-controls { margin: 0 0 19px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-block: 20px 14px; }
.catalogue-controls .tabs { grid-column: 2; }
.catalogue-controls > span { justify-self: end; color: var(--muted); font-size: .88rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; color: var(--muted); background: var(--surface); font-size: .9rem; }
.tabs a[aria-current], .tabs a:hover { color: #fff5e5; background: var(--wine); border-color: var(--wine); }
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px; }
.product-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.product-photo { aspect-ratio: 1.34; display: block; position: relative; overflow: hidden; }
.product-photo img, .detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo img { transition: transform .26s ease; }
.product-photo:hover img { transform: scale(1.035); }
.product-photo span { position: absolute; top: 13px; left: 13px; padding: 4px 11px; background: var(--surface); border-radius: 2px; font-size: .84rem; color: var(--wine); }
.product-copy { padding: 17px 20px 20px; }
.product-copy p { color: var(--muted); font-size: .87rem; margin-bottom: 7px; }
.product-copy > div { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; }
.product-copy strong, .price, .total strong { color: var(--wine); font-size: 1.32rem; font-weight: 740; }
.round-link { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--wine); flex: 0 0 auto; }
.round-link:hover { background: var(--wine); color: white; }
.footer { background: #39241f; color: #faeedc; }
.footer-row { display: flex; justify-content: space-between; align-items: center; min-height: 140px; gap: 18px; padding-block: 24px; }
.footer strong { font: 700 1.55rem var(--serif); letter-spacing: .16em; }
.footer p, .footer-links { color: #e5d2bd; font-size: .9rem; margin-top: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 17px; }
.footer-links a:hover { text-decoration: underline; }
.page { padding-block: 42px 68px; }
.page-head { margin-bottom: 24px; width: fit-content; max-width: 100%; background: var(--surface); border-radius: 5px; padding: 8px 18px; }
.page-head p { color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.narrow { max-width: 535px; }
.back { display: inline-block; color: var(--wine); background: var(--surface); border-radius: 3px; padding: 5px 11px; margin-bottom: 17px; }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }
.checkout-grid { grid-template-columns: 1.55fr 1fr; }
.panel, .product-detail article { padding: clamp(18px, 3vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.panel h2 { margin-bottom: 13px; }
.panel p { margin-block: 8px; }
.panel > a.full { margin-top: 19px; }
.empty { text-align: center; }
.empty .button { margin-top: 18px; }
.detail-photo { overflow: hidden; border-radius: 6px; aspect-ratio: 1.21; }
.image-placeholder { width: 100%; height: 100%; min-height: 65px; display: grid; place-items: center; background: #eee0cd; color: var(--wine); font: 700 2rem var(--serif); }
.product-detail article > * + * { margin-top: 16px; }
.product-action { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.product-action input { width: 80px; }
.prose { white-space: pre-line; line-height: 1.8; }
.muted { color: var(--muted); }
.demo { margin: 0 0 12px; color: #634427; background: #fff1d7; border-radius: 3px; padding: 8px 12px; width: fit-content; font-size: .9rem; }
.form-stack { display: grid; gap: 15px; align-items: start; }
.form-stack > .button { justify-self: start; }
.form-stack h2, .form-stack p { margin-bottom: 0; }
.form-stack p a { color: var(--wine); text-decoration: underline; }
label { display: grid; gap: 6px; font-size: .93rem; }
input, select, textarea { display: block; width: 100%; border: 1px solid #bdaea0; border-radius: 3px; min-height: 43px; padding: 8px 10px; background: #fffdf8; color: var(--ink); }
input[type="file"] { padding: 7px; }
input[type="color"] { padding: 4px; }
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--wine); }
fieldset { border: 1px solid var(--line); margin: 0; }
legend { padding: 0 5px; }
.choice { display: flex; align-items: center; gap: 8px; padding-block: 4px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.bill-items { padding: 0; margin: 0; list-style: none; }
.bill-items li, .total { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.bill-items li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.bill-items li strong { white-space: nowrap; }
.total { margin-top: 14px; }
.message, .key-panel { border: 1px solid #d6a96e; color: #633a24; background: #fff2da; }
.message { margin-top: 15px; padding: 12px 15px; border-radius: 5px; }
.key-panel { margin-bottom: 24px; }
.key-panel input { max-width: 390px; font-family: ui-monospace, monospace; }
.payment-qr { width: min(210px, 100%); }
.cart-item, .order-row, .upload-preview { display: flex; align-items: center; gap: 15px; }
.cart-item { padding-block: 13px; border-bottom: 1px solid var(--line); }
.cart-item > div:not(.thumb), .order-row > div:not(.thumb) { flex: 1; min-width: 0; }
.cart-item label { max-width: 78px; }
.thumb { width: 68px; height: 64px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.orders { display: grid; gap: 12px; margin-top: 16px; }
.order-row h2 { font-size: 1.16rem; margin: 0; }
.order-row p { margin: 5px 0 0; }
.order-row > div:nth-child(2) strong { margin-inline: 8px 0; white-space: nowrap; }
.status { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: .88rem; background: #f2e4c8; color: #69431d; white-space: nowrap; }
.status.paid, .status.shipped { background: #deecda; color: #254823; }
.status.cancelled { background: #ebe7e4; color: #514942; }
.admin-bar, .pagination { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }
.pagination { margin-block: 14px; }
details > summary { font-weight: 700; }
details[open] > summary { margin-bottom: 14px; }
.admin-order > form { margin-top: 12px; }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 48px); }
  .products { gap: 12px; }
  .product-copy { padding: 13px; }
  .hero-image { object-position: 57%; }
  .hero-shade { background: linear-gradient(90deg, #29060bea, #33090ca8 48%, #35060b30 100%); }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .header-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding-top: 12px; }
  .header-row nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 27px; }
  .header-row nav a { padding-block: 9px; }
  .brand strong { font-size: 24px; }
  .seal { width: 37px; height: 37px; }
  .hero { min-height: 455px; }
  .hero-image { object-position: 58%; }
  .hero-copy { width: min(325px, 100%); }
  .hero h1 { font-size: clamp(3.05rem, 12vw, 4.2rem); }
  .catalogue { padding-block: 33px 45px; }
  .catalogue-controls { display: flex; flex-direction: column; gap: 11px; padding-inline: 4px; }
  .catalogue-controls .tabs { justify-content: center; }
  .tabs a { padding-inline: 10px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-copy h3 { font-size: 1.08rem; }
  .product-copy strong { font-size: 1.06rem; }
  .round-link { width: 29px; height: 29px; }
  .split { grid-template-columns: 1fr; }
  .checkout-grid > aside { grid-row: 1; }
  .footer-row { align-items: start; flex-direction: column; }
  .order-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
