:root {
  --ink: #161312;
  --muted: #645c55;
  --paper: #f7f2ec;
  --white: #fffdf9;
  --line: #ded1c2;
  --coffee: #59351f;
  --coffee-dark: #2a1810;
  --leaf: #69785f;
  --clay: #b76642;
  --gold: #d6a85b;
  --shadow: 0 18px 50px rgba(42, 24, 16, 0.14);
  font-family: "IBM Plex Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(22, 19, 18, 0.94);
  color: var(--white);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 253, 249, 0.55);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #cfc3b8;
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 38px);
  font-weight: 700;
}

.site-nav a,
.cart-link {
  text-decoration: none;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

[data-cart-count] {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.78rem;
}

.section,
.hero,
.page-hero {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 5vw, 64px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: clamp(30px, 6vw, 86px);
  min-height: calc(100vh - 76px);
  background:
    linear-gradient(115deg, rgba(42, 24, 16, 0.88), rgba(89, 53, 31, 0.76)),
    url("../assets/img/hero-products.png") center / cover;
  color: var(--white);
}

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

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

.hero .eyebrow {
  color: var(--gold);
}

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(3rem, 8vw, 7.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.08;
}

.lead {
  color: inherit;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero .lead {
  max-width: 560px;
  color: #eee4da;
}

.hero-actions,
.product-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.button,
button.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  background: var(--coffee-dark);
  color: var(--white);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--coffee-dark);
}

.hero .button.secondary {
  border-color: rgba(255, 253, 249, 0.55);
  color: var(--white);
}

.hero-card {
  align-self: end;
  border: 1px solid rgba(255, 253, 249, 0.24);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 253, 249, 0.1);
  backdrop-filter: blur(14px);
}

.hero-card ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hero-card li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(255, 253, 249, 0.18);
  padding: 12px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.section-heading p {
  max-width: 560px;
  color: var(--muted);
}

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

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

.product-card,
.profile-panel,
.order-summary,
.checkout-form,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
}

.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #ece1d5;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

.product-media span {
  position: absolute;
  top: 14px;
  left: 14px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--coffee-dark);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
}

.product-info,
.profile-panel {
  padding: 20px;
}

.product-info p,
.profile-panel p,
.method-note,
.checkout-note {
  color: var(--muted);
}

.checkout-status {
  border-radius: 6px;
  padding: 12px 14px;
  background: #efe6d9;
  color: var(--coffee-dark);
  font-weight: 800;
}

.checkout-status[data-status="error"] {
  background: #f5ded8;
  color: #8a2d1e;
}

.profile-panel dl {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.profile-panel div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--coffee);
  font-weight: 900;
}

dd {
  margin: 0;
  color: var(--muted);
}

.origin-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 32px;
  background: var(--coffee-dark);
  color: var(--white);
}

.origin-band p {
  color: #d9cfc5;
}

.origin-stats {
  display: grid;
  gap: 14px;
}

.origin-stats div {
  border: 1px solid rgba(255, 253, 249, 0.16);
  border-radius: 8px;
  padding: 18px;
}

.origin-stats strong {
  display: block;
  color: var(--gold);
  font-size: 2rem;
}

.page-hero {
  padding-bottom: 32px;
}

.page-hero p {
  max-width: 720px;
  color: var(--muted);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
  padding: clamp(28px, 5vw, 64px);
}

.product-detail-media {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ece1d5;
}

.product-detail-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: clamp(22px, 5vw, 52px);
}

.taste-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.taste-list span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.buy-box,
.checkout-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--coffee);
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.buy-total,
.order-summary div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.cart-layout,
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
  padding: 0 clamp(18px, 5vw, 64px) clamp(56px, 8vw, 104px);
}

.cart-lines {
  display: grid;
  gap: 16px;
}

.cart-line {
  display: grid;
  grid-template-columns: 108px 1fr 130px;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
}

.cart-line img {
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 6px;
  background: #ece1d5;
}

.order-summary {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.summary-total {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 1.25rem;
}

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

.empty-state {
  grid-column: 1 / -1;
  padding: clamp(36px, 6vw, 72px);
  text-align: center;
}

.result-page {
  min-height: 58vh;
}

.institutional {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 32px;
  align-items: center;
  background: #ebe3d9;
}

.institutional-panel {
  border-left: 5px solid var(--leaf);
  padding: 22px;
  background: var(--white);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 64px);
  background: var(--ink);
  color: var(--white);
}

.site-footer p {
  color: #cfc3b8;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-content: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  transform: translateY(20px);
  border-radius: 8px;
  padding: 14px 18px;
  background: var(--coffee-dark);
  color: var(--white);
  opacity: 0;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

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

  .site-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .origin-band,
  .institutional,
  .product-detail,
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

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

  .order-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 14px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 64px;
  }

  .section-heading,
  .site-footer {
    display: grid;
  }

  .product-grid,
  .profiles-grid,
  .taste-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: 82px 1fr;
  }

  .cart-line label {
    grid-column: 1 / -1;
  }
}
