:root {
  --bg: #f7fbf3;
  --bg-soft: #eef8e9;
  --surface: #ffffff;
  --surface-strong: #e4f4dc;
  --text: #172116;
  --muted: #60705d;
  --border: #d9e7d3;
  --accent: #2f8f46;
  --accent-2: #8bcf7a;
  --accent-dark: #1e6530;
  --gold: #c99b3b;
  --danger: #b33d3d;
  --shadow: 0 22px 55px rgba(34, 83, 39, 0.12);
  --radius: 22px;
  --radius-sm: 12px;
  --max: 1180px;
}

body.is-authenticated {
  --bg: #f0f8ed;
  --bg-soft: #dff2d8;
  --surface: #fbfff8;
  --surface-strong: #d4edca;
  --accent: #216f37;
  --accent-2: #6fbf63;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(139, 207, 122, 0.14), transparent 420px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

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

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  background: rgba(247, 251, 243, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

body.is-authenticated .site-header {
  background: rgba(240, 248, 237, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.85), transparent 34%),
    linear-gradient(145deg, #b9ef9a, #2f8f46 58%, #145326);
  color: #fff;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 36px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(47, 143, 70, 0.28);
}

.small-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 28px;
}

.brand-text {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  color: var(--accent-dark);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: #31412f;
  font-size: 14px;
  font-weight: 650;
}

.nav a {
  padding: 8px 0;
}

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

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

.profile-wrap {
  position: relative;
}

.profile-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 12px 7px 7px;
  font-weight: 850;
}

.profile-avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  display: none;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-menu.open {
  display: grid;
  gap: 4px;
}

.profile-menu a,
.profile-menu button {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  font-weight: 750;
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: var(--bg-soft);
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
}

[data-cart-count] {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 26px rgba(47, 143, 70, 0.22);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent-dark);
  border-color: var(--border);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 800;
}

.container,
.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.hero {
  width: min(var(--max), calc(100% - 40px));
  margin: 26px auto 0;
  min-height: auto;
  display: block;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 6vw, 72px);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 247, 224, 0.92)),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-copy h1 {
  margin: 0;
  max-width: 880px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(46px, 7vw, 88px);
  line-height: 0.96;
  color: #173418;
}

.hero-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-visual {
  display: none;
}

.hero-visual::after {
  content: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.section-head h1,
.section-head h2,
.page-title h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.page-title {
  padding: 58px 0 26px;
}

.page-title p,
.section-head p {
  margin: 10px 0 0;
  max-width: 660px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.stat {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat strong {
  display: block;
  color: var(--accent-dark);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.chip.active,
.chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.product-card,
.category-card,
.creator-card,
.panel,
.summary-card,
.cart-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(32, 82, 37, 0.08);
}

.product-card {
  overflow: hidden;
}

.product-image {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-strong);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.04);
}

.product-body {
  padding: 18px;
}

.product-body h3 {
  min-height: 54px;
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.product-body p {
  min-height: 52px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

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

.product-meta strong,
.price-line {
  color: var(--accent-dark);
  font-weight: 900;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.feature-band {
  padding: 38px;
  border-radius: 30px;
  background: var(--surface-strong);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.panel {
  padding: 28px;
}

form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(47, 143, 70, 0.15);
}

.upload-form {
  display: grid;
  gap: 16px;
}

.form-status,
.small {
  color: var(--muted);
  font-size: 13px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
  gap: 34px;
  align-items: start;
  padding: 36px 0 72px;
}

.detail-image {
  border-radius: 30px;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.detail-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.detail-copy {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-copy h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1;
}

.detail-copy p {
  color: var(--muted);
}

.seller-box {
  margin: 18px 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.cart-layout,
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

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

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.cart-item img {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-strong);
}

.cart-item h3 {
  margin: 0;
}

.cart-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.qty button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
}

.summary-card {
  padding: 24px;
  position: sticky;
  top: 96px;
}

.summary-card h2 {
  margin-top: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.category-card,
.creator-card {
  padding: 24px;
}

.category-card h3,
.creator-card h3 {
  margin: 14px 0 8px;
  font-size: 24px;
}

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

.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 24px;
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.contact-card a {
  color: var(--accent-dark);
  font-size: 28px;
  font-weight: 900;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  text-align: center;
  grid-column: 1 / -1;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(23, 33, 22, 0.42);
  backdrop-filter: blur(10px);
}

.login-modal.open {
  display: grid;
}

.modal-open {
  overflow: hidden;
}

.login-dialog {
  position: relative;
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 18px;
}

.login-dialog h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 38px;
  line-height: 1;
}

.login-dialog p {
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 14px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(34, 83, 39, 0.1);
}

.email-auth-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.email-auth-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.google-login {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #172116;
  font-weight: 900;
}

.google-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f6f0;
  color: #2f5bca;
}

.account-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 72px;
}

.account-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-sidebar h2,
.account-sidebar p {
  margin: 0;
}

.account-sidebar p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-sidebar a,
.account-sidebar button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  font-weight: 800;
}

.account-sidebar a.active,
.account-sidebar a:hover,
.account-sidebar button:hover {
  background: var(--bg-soft);
}

.large-avatar {
  width: 72px;
  height: 72px;
  font-size: 30px;
}

.account-main {
  display: grid;
  gap: 18px;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.settings-form label:has(textarea),
.settings-form button,
.settings-form .form-status {
  grid-column: 1 / -1;
}

.profile-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.account-tile {
  display: grid;
  gap: 6px;
}

.account-tile span {
  color: var(--muted);
  font-weight: 800;
}

.success-card {
  width: min(760px, 100%);
  margin: 70px auto 90px;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.success-card h1 {
  margin: 10px 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
}

.success-card p {
  color: var(--muted);
}

.success-icon {
  width: 72px;
  height: 72px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 38px;
  font-weight: 900;
}

.site-footer {
  margin-top: 80px;
  padding: 44px max(20px, calc((100vw - var(--max)) / 2));
  background: #173418;
  color: #edf8e9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 28px;
}

.site-footer .brand-text {
  color: #fff;
}

.site-footer p,
.site-footer a {
  display: block;
  color: #cfe4c9;
  margin: 8px 0;
}

.site-footer h3 {
  margin: 0 0 12px;
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #cfe4c9;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 90px);
  padding: 13px 18px;
  border-radius: 999px;
  background: #173418;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

#toast.show {
  transform: translate(-50%, 0);
}

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

  .hero,
  .detail-layout,
  .feature-band,
  .cart-layout,
  .checkout-grid,
  .contact-card,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .grid,
  .stats,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-card {
    position: static;
  }

  .account-sidebar {
    position: static;
  }

  .profile-panels,
  .settings-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container,
  .section,
  .hero {
    width: min(100% - 28px, var(--max));
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    padding: 30px;
  }

  .hero-visual {
    min-height: 300px;
  }

  .grid,
  .stats,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .cart-item img {
    width: 76px;
    height: 76px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
  }
}
