:root {
  --bg: #f7f2ea;
  --surface: #ffffff;
  --surface-soft: #f4efe9;
  --primary: #7a4b2a;
  --primary-dark: #5d3418;
  --accent: #d8a16a;
  --text: #1f1b18;
  --muted: #6f665f;
  --border: rgba(31, 27, 24, 0.08);
  --shadow: 0 15px 35px rgba(53, 36, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

button,
select {
  font: inherit;
}

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

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 242, 234, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button,
.cart-button,
.category,
.btn,
.close-cart,
.qty-btn,
.add-to-cart {
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.hero {
  padding: 52px 0 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.hero-text {
  max-width: 560px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats strong {
  font-size: 1.5rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.book-stack {
  position: relative;
  width: min(440px, 100%);
  height: 430px;
}

.book-card {
  position: absolute;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  color: white;
}

.book-card-large {
  right: 25px;
  bottom: 20px;
  width: 270px;
  height: 310px;
  background: linear-gradient(160deg, #c58452, #8d4d2c);
  transform: rotate(8deg);
}

.book-card-small {
  left: 20px;
  top: 30px;
  width: 200px;
  height: 190px;
  background: linear-gradient(160deg, #2b2f45, #1c2137);
  transform: rotate(-10deg);
}

.tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.book-card h3 {
  margin: 26px 0 8px;
  font-size: 1.9rem;
}

.book-card p {
  margin: 0 0 16px;
  opacity: 0.95;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  font-weight: 700;
}

.price-row span {
  text-decoration: line-through;
  opacity: 0.75;
  font-size: 0.9rem;
}

.category-strip {
  padding: 14px 0 12px;
}

.categories {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.category {
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
}

.category.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.section {
  padding: 64px 0;
}

.alt-bg {
  background: rgba(255, 255, 255, 0.32);
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.7rem);
  letter-spacing: -0.04em;
}

.row-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.sort-box select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 25px rgba(23, 19, 17, 0.04);
}

.product-cover {
  height: 230px;
  background: linear-gradient(160deg, #f2d9bd, #efe1d1);
  display: grid;
  place-items: center;
  font-size: 3rem;
  position: relative;
}

.product-cover::after {
  content: attr(data-symbol);
}

.product-body {
  padding: 18px 18px 20px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.product-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.product-desc {
  color: var(--muted);
  margin: 0 0 16px;
  min-height: 48px;
}

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

.price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.add-to-cart {
  background: #f5eadf;
  color: var(--primary);
  border: 1px solid rgba(122, 75, 42, 0.15);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.2rem;
}

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

.value-card,
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 22px;
}

.value-card .icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.value-card h3,
.testimonial strong {
  margin: 0 0 10px;
}

.value-card p,
.testimonial p {
  color: var(--muted);
  margin: 0;
}

.testimonial .stars {
  color: #f3b74d;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.site-footer {
  padding-top: 24px;
  background: #201d1b;
  color: rgba(255, 255, 255, 0.86);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 26px;
  padding: 36px 0;
}

.footer-brand {
  margin-bottom: 16px;
}

.site-footer h4 {
  margin-top: 0;
  margin-bottom: 14px;
  color: white;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 0 30px;
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(390px, 100%);
  height: 100vh;
  background: var(--surface);
  box-shadow: -20px 0 35px rgba(23, 19, 17, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header,
.cart-footer {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.close-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5eee9;
  font-size: 1.6rem;
  color: var(--text);
}

.cart-items {
  flex: 1;
  overflow: auto;
  padding: 16px 18px;
  display: grid;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #faf7f3;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.cart-thumb {
  width: 60px;
  height: 78px;
  border-radius: 12px;
  background: linear-gradient(160deg, #f2d9bd, #efe1d1);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cart-item h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.full-width {
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 27, 24, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.checkout-modal {
  width: min(620px, 100%);
  max-height: min(760px, 100vh - 40px);
  overflow: auto;
  padding: 26px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(23, 19, 17, 0.25);
}

.checkout-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.checkout-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.checkout-header .eyebrow {
  margin-bottom: 6px;
}

.checkout-form {
  display: grid;
  gap: 20px;
}

.checkout-form[hidden],
.checkout-success[hidden],
.bank-transfer-instructions[hidden] {
  display: none;
}

.checkout-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkout-form label,
.checkout-form legend {
  font-weight: 700;
  font-size: 0.9rem;
}

.checkout-form input[type="text"],
.checkout-form input[type="tel"] {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #faf7f3;
}

.checkout-form input:focus {
  outline: 2px solid rgba(122, 75, 42, 0.25);
  border-color: var(--primary);
}

.field-wide {
  grid-column: 1 / -1;
}

.checkout-form fieldset {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
}

.payment-option {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 12px;
  background: #faf7f3;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.payment-option input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.payment-option span {
  display: grid;
  gap: 2px;
}

.payment-option small {
  color: var(--muted);
  font-weight: 400;
}

.checkout-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.checkout-summary span {
  color: var(--muted);
}

.checkout-summary .summary-total {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.checkout-message {
  min-height: 24px;
  margin: 0;
  color: #a33c2c;
  font-size: 0.92rem;
}

.checkout-message.success {
  color: #28734e;
}

.bank-transfer-instructions {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #faf7f3;
}

.bank-transfer-instructions h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.bank-transfer-instructions img {
  width: min(240px, 100%);
  margin: 0 auto 14px;
}

.bank-transfer-instructions dl {
  display: grid;
  grid-template-columns: minmax(105px, auto) 1fr;
  gap: 6px 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.bank-transfer-instructions dt {
  color: var(--muted);
}

.bank-transfer-instructions dd {
  margin: 0;
  font-weight: 700;
}

.bank-transfer-instructions p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.checkout-success {
  padding: 28px 12px 8px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e4f3e9;
  color: #28734e;
  font-size: 1.8rem;
  font-weight: 800;
}

.checkout-success h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.checkout-success p {
  margin: 8px 0;
  color: var(--muted);
}

.checkout-success strong {
  color: var(--text);
}

.checkout-success .btn {
  margin-top: 16px;
}

@media (max-width: 980px) {
  .hero-grid,
  .values-grid,
  .testimonial-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .main-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-grid,
  .values-grid,
  .testimonial-grid,
  .footer-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-actions,
  .header-actions,
  .row-heading {
    flex-wrap: wrap;
  }

  .header-inner {
    min-height: 66px;
  }

  .book-stack {
    height: 300px;
  }

  .book-card-large {
    width: 220px;
    height: 260px;
  }

  .book-card-small {
    width: 170px;
    height: 160px;
  }

  .checkout-modal {
    padding: 20px;
  }

  .checkout-fields {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }
}
