:root {
  --brew-primary: #6f4e37;
  --brew-primary-dark: #4b2e1f;
  --brew-primary-light: #a5744d;
  --brew-accent: #c89462;
  --brew-accent-soft: #ead8c4;
  --brew-bg: #f6efe6;
  --brew-bg-soft: #efe1d0;
  --brew-bg-strong: #e6d1bb;
  --brew-text: #24160f;
  --brew-text-soft: #765c49;
  --brew-border: #d7bfa7;
  --brew-card: rgba(255, 250, 244, 0.84);
  --brew-shadow: 0 18px 48px rgba(75, 46, 31, 0.14);
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--brew-text);
  background:
    radial-gradient(circle at top right, rgba(200, 148, 98, 0.18), transparent 28%),
    radial-gradient(circle at left 18%, rgba(111, 78, 55, 0.12), transparent 24%),
    linear-gradient(180deg, #faf4ed 0%, #f3e7d8 100%);
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

img,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

.line-clamp-1,
.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; }

main section,
main article,
main aside,
main div,
header,
footer {
  max-width: 100%;
}

.brew-noise::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.25;
  pointer-events: none;
}

.brew-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 1024px) {
  .brew-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
    align-items: center;
  }
}

.brew-panel {
  background: var(--brew-card);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(75, 46, 31, 0.1);
  box-shadow: var(--brew-shadow);
}

.brew-card {
  background: rgba(255, 248, 241, 0.9);
  border: 1px solid rgba(75, 46, 31, 0.1);
  box-shadow: 0 12px 28px rgba(75, 46, 31, 0.08);
}

.brew-stat {
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,248,241,0.8));
  border: 1px solid rgba(75, 46, 31, 0.1);
}

.brew-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(111, 78, 55, 0.08);
  border: 1px solid rgba(111, 78, 55, 0.14);
  color: var(--brew-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brew-badge::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brew-primary-light), var(--brew-primary-dark));
}

.machine-stage {
  position: relative;
  min-height: 420px;
  border-radius: 2rem;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(255,250,244,0.98) 0%, rgba(236,220,203,0.95) 45%, rgba(215,191,167,0.85) 100%);
  border: 1px solid rgba(75, 46, 31, 0.1);
  box-shadow: var(--brew-shadow);
}

.machine-stage::before {
  content: "";
  position: absolute;
  inset: 1.25rem;
  border-radius: 1.5rem;
  border: 1px dashed rgba(111, 78, 55, 0.18);
}

.machine-stage::after {
  content: "";
  position: absolute;
  inset: auto 8% 8% 8%;
  height: 18%;
  background: radial-gradient(ellipse at center, rgba(75, 46, 31, 0.22), transparent 68%);
  filter: blur(12px);
}

.machine-silhouette {
  position: absolute;
  inset: 14% 10% 12% 10%;
  display: grid;
  place-items: center;
}

.machine-body {
  position: relative;
  width: min(92%, 480px);
  aspect-ratio: 4 / 3;
  border-radius: 2rem;
  background:
    linear-gradient(145deg, #f9f2ea 0%, #d4baa1 42%, #8d6546 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 24px 40px rgba(75, 46, 31, 0.18);
}

.machine-body::before {
  content: "";
  position: absolute;
  top: 10%;
  left: 10%;
  right: 42%;
  bottom: 18%;
  border-radius: 1.5rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(235,222,208,0.95) 100%);
  box-shadow: inset 0 -8px 22px rgba(75, 46, 31, 0.08);
}

.machine-body::after {
  content: "";
  position: absolute;
  top: 15%;
  right: 8%;
  width: 24%;
  height: 52%;
  border-radius: 1.4rem;
  background:
    linear-gradient(180deg, #4c2f20 0%, #24160f 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.machine-head {
  position: absolute;
  top: 15%;
  left: 20%;
  width: 28%;
  height: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f4e37, #a5744d);
  z-index: 2;
}

.machine-cup {
  position: absolute;
  bottom: 18%;
  left: 26%;
  width: 18%;
  height: 18%;
  border-radius: 0 0 1.3rem 1.3rem;
  background: linear-gradient(180deg, #fffaf5 0%, #ebddcf 100%);
  border: 3px solid rgba(75, 46, 31, 0.16);
  z-index: 2;
}

.machine-cup::before {
  content: "";
  position: absolute;
  top: 26%;
  right: -26%;
  width: 32%;
  height: 34%;
  border: 3px solid rgba(75, 46, 31, 0.16);
  border-left: 0;
  border-radius: 0 1rem 1rem 0;
}

.machine-cup::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 12%;
  right: 12%;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(180deg, #75421d, #4b2e1f);
}

.machine-beans {
  position: absolute;
  right: 14%;
  bottom: 10%;
  display: flex;
  gap: 0.55rem;
}

.machine-beans span {
  width: 1.1rem;
  height: 1.4rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #7f5539, #4b2e1f);
  transform: rotate(20deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.machine-beans span:nth-child(2) { transform: rotate(-8deg); }
.machine-beans span:nth-child(3) { transform: rotate(14deg); }

.steam {
  position: absolute;
  left: 29%;
  top: 12%;
  width: 18%;
  height: 28%;
  z-index: 3;
}

.steam span {
  position: absolute;
  bottom: 0;
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.55));
  filter: blur(5px);
  animation: steamRise 4.5s ease-in-out infinite;
}

.steam span:nth-child(1) { left: 0; animation-delay: 0s; }
.steam span:nth-child(2) { left: 32%; animation-delay: 0.8s; }
.steam span:nth-child(3) { left: 64%; animation-delay: 1.6s; }

@keyframes steamRise {
  0%, 100% { transform: translateY(10px) scale(0.88); opacity: 0.08; }
  50% { transform: translateY(-12px) scale(1.06); opacity: 0.4; }
}

.section-shell {
  position: relative;
}

.section-shell::before {
  content: "";
  position: absolute;
  inset: auto 0 100% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(75,46,31,0.16), transparent);
}

body[data-page="about"] .story-grid,
body[data-page="contact"] .contact-wrap,
body[data-page="my-details"] .account-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  body[data-page="about"] .story-grid {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: center;
  }

  body[data-page="contact"] .contact-wrap {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }

  body[data-page="my-details"] .account-shell {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }
}

body[data-page="about"] .story-media,
body[data-page="contact"] .contact-panel,
body[data-page="my-details"] .profile-panel,
body[data-page="my-details"] .orders-panel {
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid rgba(75, 46, 31, 0.1);
  border-radius: 2rem;
  box-shadow: var(--brew-shadow);
  backdrop-filter: blur(14px);
}

body[data-page="contact"] .contact-panel {
  position: relative;
  overflow: hidden;
}

body[data-page="contact"] .contact-panel::after {
  content: "";
  position: absolute;
  inset: auto -15% -10% auto;
  width: 230px;
  height: 230px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(200,148,98,0.3), transparent 68%);
}

body[data-page="my-details"] #orders-container .order-card {
  background: rgba(255,250,244,0.9);
  border: 1px solid rgba(75, 46, 31, 0.1);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(75,46,31,0.08);
}

body[data-page="cart"] main,
body[data-page="wishlist"] main {
  position: relative;
}

body[data-page="cart"] main::before,
body[data-page="wishlist"] main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(200, 148, 98, 0.16), transparent 24%),
    radial-gradient(circle at left 12%, rgba(111, 78, 55, 0.12), transparent 24%);
  opacity: 0.85;
}

body[data-page="cart"] main > *,
body[data-page="wishlist"] main > * {
  position: relative;
  z-index: 1;
}

body[data-page="cart"] #cart-empty,
body[data-page="wishlist"] #wishlist-empty {
  background: rgba(255, 250, 244, 0.88);
  border: 1px solid rgba(75, 46, 31, 0.1);
  border-radius: 2rem;
  box-shadow: var(--brew-shadow);
  overflow: hidden;
}

body[data-page="cart"] #cart-content,
body[data-page="wishlist"] #wishlist-content {
  position: relative;
}

body[data-page="cart"] #cart-list > div,
body[data-page="wishlist"] #wishlist-list > div {
  background: rgba(255, 250, 244, 0.9) !important;
  border-color: rgba(75, 46, 31, 0.1) !important;
  box-shadow: 0 12px 28px rgba(75, 46, 31, 0.08) !important;
  border-radius: 1.5rem !important;
}

body[data-page="cart"] #cart-list img,
body[data-page="wishlist"] #wishlist-list img {
  background: linear-gradient(180deg, #fffaf4 0%, #efe1d0 100%);
}

@media (max-width: 639px) {
  body[data-page="contact"] .contact-wrap {
    gap: 1rem;
  }

  body[data-page="contact"] .contact-panel {
    border-radius: 1.5rem;
  }

  body[data-page="contact"] .contact-panel h1 {
    letter-spacing: -0.01em;
  }

  body[data-page="contact"] .contact-panel form input,
  body[data-page="contact"] .contact-panel form select,
  body[data-page="contact"] .contact-panel form textarea {
    font-size: 14px;
  }

  body[data-page="contact"] .contact-panel .grid.grid-cols-3 > div {
    min-height: 96px;
  }
}

body[data-page="cart"] #cart-content .bg-white\/85,
body[data-page="wishlist"] #wishlist-content .bg-white\/85 {
  background: rgba(255, 250, 244, 0.9);
  border-color: rgba(75, 46, 31, 0.1);
}

body[data-page="cart"] #cart-empty .w-24,
body[data-page="wishlist"] #wishlist-empty .w-24 {
  box-shadow: inset 0 0 0 1px rgba(75, 46, 31, 0.08);
}

body[data-page="cart"] .text-accent,
body[data-page="wishlist"] .text-accent {
  color: var(--brew-primary);
}

body[data-page="cart"] .bg-accent,
body[data-page="wishlist"] .bg-accent {
  background-color: var(--brew-primary) !important;
}

body[data-page="cart"] .bg-accent\/10,
body[data-page="wishlist"] .bg-accent\/10 {
  background-color: rgba(111, 78, 55, 0.1) !important;
}

body[data-page="cart"] .border-accent,
body[data-page="wishlist"] .border-accent {
  border-color: rgba(111, 78, 55, 0.28) !important;
}

body[data-page="cart"] .hover\:bg-accent:hover,
body[data-page="wishlist"] .hover\:bg-accent:hover {
  background-color: var(--brew-primary-dark) !important;
}

body[data-page="cart"] .hover\:text-accent:hover,
body[data-page="wishlist"] .hover\:text-accent:hover {
  color: var(--brew-primary) !important;
}

body[data-page="cart"] .bg-gray-50,
body[data-page="wishlist"] .bg-gray-50 {
  background: rgba(255, 250, 244, 0.92) !important;
}

body[data-page="cart"] .bg-gray-100,
body[data-page="wishlist"] .bg-gray-100 {
  background: rgba(239, 225, 208, 0.9) !important;
}

body[data-page="cart"] .text-textLight,
body[data-page="wishlist"] .text-textLight {
  color: var(--brew-text-soft) !important;
}

.brew-login-shell {
  border-radius: 2rem;
  box-shadow: 0 24px 60px rgba(45, 34, 28, 0.22);
  background: var(--brew-cream);
  border: 1px solid rgba(75, 46, 31, 0.12);
}

.brew-login-hero {
  background:
    linear-gradient(160deg, rgba(45, 34, 28, 0.98), rgba(111, 78, 55, 0.92)),
    linear-gradient(180deg, rgba(255, 250, 244, 0.08), rgba(255, 250, 244, 0));
  min-height: 100%;
}

.brew-login-form {
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(246, 239, 230, 0.98));
}

.brew-register-shell {
  border-radius: 2rem;
  box-shadow: 0 24px 60px rgba(45, 34, 28, 0.18);
  background: var(--brew-cream);
  border: 1px solid rgba(75, 46, 31, 0.12);
}

.brew-register-header {
  background:
    linear-gradient(135deg, rgba(111, 78, 55, 0.98), rgba(75, 46, 31, 0.98));
}

.brew-register-form {
  background:
    radial-gradient(circle at top left, rgba(168, 106, 61, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 244, 0.99), rgba(251, 247, 242, 0.99));
}

.brew-toast {
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(45, 34, 28, 0.98), rgba(75, 46, 31, 0.96));
  border-left: 4px solid var(--brew-primary);
  box-shadow: 0 18px 40px rgba(45, 34, 28, 0.28);
}

body[data-page="policy"] .policy-shell,
body[data-page="privacy"] .policy-shell,
body[data-page="terms"] .policy-shell,
body[data-page="return-policy"] .policy-shell,
body[data-page="shipping"] .policy-shell {
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid rgba(75, 46, 31, 0.1);
  border-radius: 2rem;
  box-shadow: var(--brew-shadow);
}

.brew-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brew-pill-list span {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(111, 78, 55, 0.08);
  border: 1px solid rgba(111, 78, 55, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brew-primary-dark);
}

.brew-form-shell input,
.brew-form-shell textarea,
.brew-form-shell select {
  min-height: 3.25rem;
}

@media (max-width: 640px) {
  .machine-stage {
    min-height: 360px;
  }

  .machine-body {
    width: 95%;
  }
}
