:root {
  --bg: #f4efe6;
  --paper: #fbf7f0;
  --paper-strong: #fffdf8;
  --ink: #171513;
  --muted: #6f665d;
  --line: rgba(23, 21, 19, 0.16);
  --line-strong: rgba(23, 21, 19, 0.32);
  --accent: #8d5c2c;
  --accent-soft: #ece1cf;
  --danger: #9a342f;
  --success: #355f3f;
  --shadow: 0 14px 35px rgba(34, 24, 12, 0.08);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(201, 176, 138, 0.14), transparent 30%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 48%, #efe9de 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

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

a {
  color: inherit;
}

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

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

button:hover {
  opacity: 0.92;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line-strong);
  background: var(--paper-strong);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  background: rgba(251, 247, 240, 0.88);
}

.logo a {
  font-family: var(--serif);
  font-size: 1.45rem;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 0.94rem;
}

.top-links a,
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.top-links a:hover,
.link-button:hover {
  color: var(--ink);
}

.cart {
  position: relative;
}

.cart-toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cart-summary {
  display: inline-flex;
  align-items: center;
  min-width: 140px;
  justify-content: center;
  border: 1px solid var(--ink);
  padding: 0.7rem 0.95rem;
  background: var(--paper-strong);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
}

.cart-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 320px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 252, 246, 0.98);
  box-shadow: var(--shadow);
  display: none;
}

.cart-panel h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.cart-toggle:checked ~ .cart-panel {
  display: block;
}

.cart-panel-total {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.checkout-link {
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
  color: var(--accent);
}

.hero-band {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 28px;
  padding: 42px 28px 20px;
  align-items: end;
}

.hero-copy,
.hero-note-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.82));
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
}

.hero-copy-media {
  margin: -8px -8px 22px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.8);
  overflow: hidden;
}

.hero-copy-image {
  width: 100%;
  height: 330px;
  object-fit: cover;
  object-position: center;
}

.hero-copy h1,
.auth-card h1,
.admin-section h1,
.collection-header h2,
.product-page-heading h1,
.product-card h3 {
  font-family: var(--serif);
  line-height: 1.04;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.9rem, 6vw, 5.8rem);
  letter-spacing: 0.02em;
}

.hero-lead {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.hero-note-card {
  padding: 26px;
}

.hero-card-image {
  width: 100%;
  aspect-ratio: 1.1 / 1;
  object-fit: cover;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}

.hero-note-label {
  margin-top: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero-note-card h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 2rem;
}

.breadcrumb {
  padding: 6px 28px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 22px 28px 32px;
}

.sidebar,
.admin-section,
.auth-card,
.checkout-summary-box,
.checkout-form,
.product-card,
.product-info,
.product-image,
.product-admin-card,
.order-card,
.card-form {
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.92);
  box-shadow: var(--shadow);
}

.sidebar {
  align-self: start;
  padding: 20px;
}

.sidebar h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
}

.sidebar-intro {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li + li {
  margin-top: 10px;
}

.sidebar a {
  color: var(--ink);
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--accent);
}

.collection-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  margin-bottom: 20px;
}

.collection-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.collection-description {
  max-width: 25rem;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 22px;
}

.product-card {
  padding: 14px;
}

.product-card-image-wrap {
  position: relative;
  display: block;
  aspect-ratio: 0.78 / 1;
  overflow: hidden;
  background: linear-gradient(180deg, #f7f1e7 0%, #ece2d1 100%);
  margin-bottom: 14px;
}

.product-card-image-wrap img,
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 6px 10px;
  background: rgba(255, 251, 244, 0.84);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
}

.product-card-content {
  display: grid;
  gap: 8px;
}

.product-card-kind {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.product-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.product-card h3 a {
  text-decoration: none;
}

.product-card-copy,
.product-detail-copy,
.admin-section p,
.auth-card p,
.order-card p {
  color: var(--muted);
}

.product-card-copy {
  min-height: 3.4em;
  margin: 0;
}

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

.product-price,
.product-info .price {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.product-page-heading {
  margin-bottom: 20px;
}

.product-page-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.product-detail {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
}

.product-image {
  padding: 18px;
  background: linear-gradient(180deg, #f7f0e3, #eaddc8);
}

.product-image-frame {
  position: absolute;
}

.product-image {
  position: relative;
  aspect-ratio: 1 / 1.12;
}

.product-image img {
  height: calc(100% - 0px);
  object-fit: cover;
}

.product-info {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 14px;
}

.note-grid > div {
  padding: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(141, 92, 44, 0.18);
}

.note-grid p {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.note-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--accent);
}

.site-footer {
  margin-top: 24px;
  padding: 24px 28px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 252, 246, 0.6);
}

.admin-page,
.checkout-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}

.admin-section {
  padding: 22px;
  margin-bottom: 20px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.product-admin-card + .product-admin-card {
  margin-top: 18px;
}

.product-admin-card,
.card-form,
.order-card {
  padding: 16px;
}

.product-admin-header,
.form-actions,
.order-status,
.product-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.image-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.image-links a,
.checkout-link,
.sidebar a,
.breadcrumb a {
  color: var(--accent);
}

.inline-delete {
  margin-top: 10px;
}

.inline-delete button {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.admin-order-list {
  display: grid;
  gap: 14px;
}

.auth-page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.auth-card {
  width: min(480px, 100%);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 4vw, 3rem);
}

.form-error {
  color: var(--danger);
}

.success-msg {
  color: var(--success);
}

.checkout-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 20px;
}

.checkout-summary-box,
.checkout-form {
  padding: 18px;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cart-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item-img {
  width: 58px;
  height: 72px;
  object-fit: cover;
  background: #eee4d4;
}

.cart-item-name,
.cart-item-price,
.cart-item-total {
  margin: 0;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-btn,
.remove-item-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.68rem;
}

.empty-cart-msg {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 980px) {
  .site-header,
  .layout,
  .hero-band,
  .product-detail,
  .checkout-layout,
  .collection-header {
    grid-template-columns: 1fr;
  }

  .site-header {
    justify-items: start;
  }

  .top-links,
  .product-admin-header,
  .form-actions,
  .order-status,
  .product-card-bottom {
    flex-wrap: wrap;
  }

  .sidebar {
    width: auto;
  }

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

@media (max-width: 640px) {
  .site-header,
  .hero-band,
  .layout,
  .admin-page,
  .checkout-page,
  .breadcrumb,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cart-panel {
    width: min(320px, calc(100vw - 32px));
  }

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