:root {
  --bg: #f9f2e6;
  --surface: #fffaf3;
  --ink: #2d2318;
  --muted: #6d5d49;
  --accent: #aa3f2a;
  --accent-2: #114e4e;
  --line: #e7d9c6;
  --success: #1f6f4a;
  --error: #8f2a1d;
  --shadow: 0 16px 36px rgba(45, 35, 24, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 16%, rgba(17, 78, 78, 0.12), transparent 33%),
    radial-gradient(circle at 88% 10%, rgba(170, 63, 42, 0.12), transparent 30%),
    linear-gradient(170deg, #fbf6ed 0%, #f5ecde 100%);
  position: relative;
  overflow-x: hidden;
}

.background-shape {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
}

.shape-a {
  width: 300px;
  height: 300px;
  top: -60px;
  right: -90px;
  background: rgba(17, 78, 78, 0.1);
}

.shape-b {
  width: 260px;
  height: 260px;
  bottom: -80px;
  left: -70px;
  background: rgba(170, 63, 42, 0.12);
}

.hero {
  text-align: center;
  padding: 56px 20px 30px;
  animation: hero-in 650ms ease-out both;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-2);
  font-weight: 700;
}

h1 {
  margin: 10px 0 8px;
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
}

.content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

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

.catalog-head {
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.catalog-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: card-in 500ms ease-out both;
}

.product-image-wrap {
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #f2e7d5, #e7d7bf);
  overflow: hidden;
}

.product-image-wrap.no-image::after {
  content: "Add item photo in images/items/";
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 10px;
  text-align: center;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-name {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.product-description {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.product-price {
  margin: 2px 0 8px;
  font-weight: 700;
  color: var(--accent-2);
}

.add-button,
.checkout-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.add-button {
  margin-top: auto;
  width: fit-content;
  background: linear-gradient(120deg, var(--accent-2), #21706f);
}

.add-button:hover,
.add-button:focus-visible,
.checkout-button:hover,
.checkout-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.cart-panel {
  position: sticky;
  top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.cart-empty {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cart-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.cart-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff8ed;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.cart-item-subtotal {
  color: var(--accent-2);
  white-space: nowrap;
}

.cart-controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.qty-button,
.remove-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 3px 8px;
  font-weight: 700;
  cursor: pointer;
}

.remove-button {
  font-weight: 600;
  font-size: 0.86rem;
}

.qty-value {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
}

.cart-total-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
}

.cart-subtotal-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--muted);
}

.cart-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkout-button {
  margin-top: 12px;
  width: 100%;
  background: linear-gradient(120deg, var(--accent), #c35a3f);
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
}

.cart-message {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cart-message.success {
  color: var(--success);
}

.cart-message.error {
  color: var(--error);
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 0 12px 34px;
  font-size: 0.88rem;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .store-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-top: 44px;
  }
}
