:root {
  --green: #2f4738;
  --cream: #f6f1e7;
  --charcoal: #1d1d1b;
  --taupe: #a69986;
  --copper: #8a5e3c;
  --paper: #fffaf1;
  --line: rgba(29, 29, 27, 0.14);
  --shadow: 0 20px 50px rgba(29, 29, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}

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

button {
  border: 0;
  background: var(--green);
  color: var(--cream);
  cursor: pointer;
  min-height: 44px;
  padding: 0 18px;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

button:hover {
  background: #203328;
}

.site-header {
  align-items: center;
  background: rgba(246, 241, 231, 0.94);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto auto;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--charcoal);
  display: flex;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  background: var(--paper);
  border: 1px solid var(--line);
  height: 58px;
  width: 58px;
}

.brand strong {
  display: block;
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
}

.brand small,
.eyebrow,
.section-title p,
.hero-copy p,
.account-panel p,
.admin-panel p,
.product-meta,
.cart-line small,
#termsNotice,
#checkoutMessage,
#accountStatus {
  color: rgba(29, 29, 27, 0.72);
}

.top-nav {
  display: flex;
  gap: 6px;
}

.top-nav a,
.cart-button {
  border: 1px solid var(--line);
  color: var(--charcoal);
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.top-nav a {
  background: transparent;
}

.cart-button {
  background: var(--paper);
}

#cartCount {
  background: var(--copper);
  color: white;
  display: inline-grid;
  margin-left: 8px;
  min-width: 24px;
  place-items: center;
}

main {
  display: grid;
  gap: 34px;
  padding: 28px;
}

.hero {
  background:
    linear-gradient(90deg, rgba(47, 71, 56, 0.96), rgba(47, 71, 56, 0.78)),
    linear-gradient(135deg, rgba(138, 94, 60, 0.18), transparent 42%),
    var(--green);
  color: var(--cream);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  min-height: 430px;
  padding: 46px;
}

.hero h1,
.section-title h2,
.account-panel h2,
.admin-panel h2,
.cart-header h2 {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  letter-spacing: 0;
  line-height: 1.04;
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.35rem, 7vw, 5.25rem);
  max-width: 980px;
}

.hero-copy p {
  color: rgba(246, 241, 231, 0.82);
  font-size: 1.05rem;
  max-width: 680px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.order-settings,
.filters,
.account-panel,
.orders-panel,
.admin-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.order-settings {
  align-self: end;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.mode-switch {
  border: 1px solid rgba(246, 241, 231, 0.34);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
}

.mode-switch button {
  background: transparent;
  color: var(--cream);
}

.mode-switch button.active {
  background: var(--cream);
  color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  background: #fffdf8;
  border: 1px solid var(--line);
  color: var(--charcoal);
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

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

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

.filters {
  display: grid;
  gap: 18px;
  padding: 18px;
  position: sticky;
  top: 96px;
}

.category-rail {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.category-rail button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--charcoal);
  justify-content: start;
  min-height: 36px;
  padding: 7px 10px;
  text-align: left;
}

.category-rail button:hover {
  background: rgba(47, 71, 56, 0.08);
  color: var(--green);
}

.category-rail button.active {
  background: var(--green);
  color: var(--cream);
}

.stat-grid,
.admin-stats,
.totals {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid span,
.admin-stats span {
  background: rgba(47, 71, 56, 0.08);
  border: 1px solid var(--line);
  padding: 12px;
}

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

.section-title h2,
.account-panel h2,
.admin-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.product-grid {
  display: grid;
  gap: 20px;
}

.category-section {
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  gap: 0;
}

.category-heading {
  align-items: baseline;
  background: rgba(47, 71, 56, 0.06);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
}

.category-heading h3 {
  color: var(--green);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.7rem;
  line-height: 1;
  margin: 0;
}

.category-heading span {
  color: rgba(29, 29, 27, 0.62);
  font-size: 0.84rem;
}

.featured-section {
  border-color: rgba(148, 92, 57, 0.42);
}

.featured-section .category-heading {
  background: rgba(148, 92, 57, 0.08);
}

.product-card {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  min-height: 0;
  padding: 14px 18px;
}

.product-card:last-child {
  border-bottom: 0;
}

.product-card:hover {
  background: rgba(166, 153, 134, 0.08);
}

.product-image {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(47, 71, 56, 0.08);
  border: 1px solid var(--line);
  color: var(--green);
  display: flex;
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.9rem;
  justify-content: center;
  overflow: hidden;
}

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

.product-card h3 {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.34rem;
  line-height: 1.14;
  margin: 0;
}

.product-title-row {
  display: grid;
  gap: 6px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.offer-badge {
  background: var(--copper);
  color: white;
  display: inline-block;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 7px;
  vertical-align: middle;
}

.product-meta {
  font-size: 0.82rem;
  margin: 4px 0 0;
  min-height: 0;
}

.price-row,
.cart-line,
.cart-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.cart-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.cart-header h2 {
  font-size: 2rem;
}

.cart-header button {
  flex: 0 0 auto;
  min-height: 38px;
  min-width: 38px;
  padding: 0;
}

.price {
  color: var(--green);
  font-size: 1.05rem;
  font-weight: 800;
  min-width: 112px;
  text-align: right;
}

.retail-price,
.trade-price,
.market-price {
  display: block;
  white-space: nowrap;
}

.retail-price {
  color: rgba(29, 29, 27, 0.58);
  font-size: 0.78rem;
  font-weight: 600;
}

.trade-price {
  color: var(--green);
}

.market-card .price {
  color: var(--copper);
}

.site-footer {
  background: var(--green);
  color: var(--cream);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
  padding: 34px 28px;
}

.site-footer h2 {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  margin: 0 0 10px;
}

.site-footer p {
  color: rgba(246, 241, 231, 0.82);
  max-width: 760px;
}

.site-footer .eyebrow {
  color: rgba(246, 241, 231, 0.72);
}

.site-footer address {
  border-left: 1px solid rgba(246, 241, 231, 0.28);
  font-style: normal;
  line-height: 1.6;
  min-width: 180px;
  padding-left: 24px;
}

.account-panel,
.admin-panel {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.75fr) minmax(260px, 0.75fr) minmax(260px, 0.75fr);
  padding: 26px;
}

.admin-panel {
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
}

.admin-workspace {
  display: grid;
  gap: 18px;
}

.admin-login-card {
  align-self: start;
}

.admin-toolbar {
  align-items: center;
  border: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.admin-toolbar button {
  min-height: 36px;
}

.settings-card {
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.settings-card p,
#tradeSettingsStatus,
#deliverySettingsStatus,
#productSettingsStatus,
#tradeOfferMessageStatus,
#emailTemplateStatus,
#emailSettingsStatus,
#statementStatus {
  color: rgba(29, 29, 27, 0.68);
  margin: 4px 0 0;
}

#tradeOfferMessage,
#customerEmailBody,
#managerEmailBody,
#statementBody {
  line-height: 1.45;
  min-height: 220px;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-actions button {
  flex: 1 1 160px;
}

.launch-checklist {
  display: grid;
  gap: 8px;
}

.check-row {
  border: 1px solid var(--line);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.check-row strong {
  color: var(--green);
}

.check-row small {
  color: rgba(29, 29, 27, 0.68);
}

.check-row.needs-work {
  border-color: rgba(148, 92, 57, 0.55);
  background: rgba(148, 92, 57, 0.08);
}

.check-row.needs-work strong {
  color: var(--copper);
}

.input-suffix {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-suffix strong {
  background: rgba(47, 71, 56, 0.08);
  border: 1px solid var(--line);
  border-left: 0;
  display: grid;
  min-height: 44px;
  padding: 0 13px;
  place-items: center;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
}

.checkbox-grid label {
  align-items: center;
  border: 1px solid var(--line);
  display: flex;
  font-weight: 600;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
}

.checkbox-grid input {
  min-height: 18px;
  width: 18px;
}

.panel-form {
  display: grid;
  gap: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-actions button {
  flex: 1 1 150px;
}

.trade-access {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.trade-access h3 {
  color: var(--green);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1;
  margin: 0 0 6px;
}

.orders-panel {
  padding: 26px;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.account-summary,
.order-confirmation {
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.account-summary:empty {
  display: none;
}

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

.summary-grid span,
.mini-order-list article {
  background: rgba(47, 71, 56, 0.08);
  border: 1px solid var(--line);
  padding: 10px;
}

.summary-grid small,
.mini-order-list small {
  color: rgba(29, 29, 27, 0.68);
  display: block;
  margin-top: 3px;
}

.mini-order-list {
  display: grid;
  gap: 8px;
}

.mini-order-list article {
  display: grid;
  gap: 8px;
}

.order-confirmation h3 {
  color: var(--green);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  margin: 0;
}

.order-card details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.order-card summary {
  cursor: pointer;
  font-weight: 800;
}

.order-card ul {
  margin: 10px 0;
  padding-left: 18px;
}

.order-card,
.admin-card,
.manager-order-card {
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-workspace h3 {
  color: var(--green);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 10px;
}

.admin-card {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-card span,
.admin-card small {
  color: rgba(29, 29, 27, 0.68);
  display: block;
  margin-top: 3px;
}

.contact-card label {
  align-items: center;
  display: flex;
  gap: 10px;
}

.contact-card input {
  min-height: 18px;
  width: 18px;
}

.email-log-card {
  grid-template-columns: minmax(0, 1fr);
}

.approved-label {
  border: 1px solid var(--line);
  color: var(--green);
  font-weight: 700;
  padding: 8px 10px;
}

.order-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.status-pill,
.warning-pill {
  border: 1px solid var(--line);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.warning-pill {
  color: var(--copper);
}

.manager-order-card details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.manager-order-card summary {
  cursor: pointer;
  font-weight: 800;
}

.manager-order-card ul {
  margin: 10px 0;
  padding-left: 18px;
}

.manager-order-meta {
  color: rgba(29, 29, 27, 0.68);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-actions button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--charcoal);
  min-height: 34px;
  padding: 0 10px;
}

.status-actions button:hover {
  background: rgba(47, 71, 56, 0.08);
  color: var(--green);
}

.status-actions button:disabled {
  background: var(--green);
  color: var(--cream);
  cursor: default;
}

.cart-drawer {
  background: var(--paper);
  border-left: 1px solid var(--line);
  bottom: 0;
  box-shadow: -20px 0 50px rgba(29, 29, 27, 0.16);
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto auto;
  max-height: 100vh;
  max-width: 470px;
  overflow-y: auto;
  padding: 18px 18px 24px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 180ms ease;
  width: 100%;
  z-index: 40;
}

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

.cart-items {
  display: grid;
  gap: 12px;
  min-height: 48px;
  padding: 0;
}

.cart-line {
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
}

.cart-line > div:first-child {
  min-width: 0;
}

.qty-tools {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.qty-tools button {
  min-height: 34px;
  padding: 0;
  min-width: 34px;
  width: auto;
}

.qty-tools button[aria-label="Quantity"] {
  background: #fffdf8;
  border: 1px solid var(--line);
  color: var(--charcoal);
  min-width: 76px;
  padding: 0 10px;
}

.checkout-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px 0 6px;
}

.checkout-section {
  display: grid;
  gap: 10px;
}

.checkout-section h3 {
  color: var(--green);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
  margin: 0;
}

.card-payment-panel {
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.card-payment-panel[hidden] {
  display: none;
}

.card-payment-panel p,
#cardStatus {
  color: rgba(29, 29, 27, 0.68);
  margin: 4px 0 0;
}

#cardContainer {
  background: #fffdf8;
  border: 1px solid var(--line);
  min-height: 96px;
  padding: 10px;
}

.totals {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 860px) {
  .site-header,
  .hero,
  .shop-layout,
  .account-panel,
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .filters {
    position: static;
  }

  .account-panel {
    grid-template-columns: 1fr;
  }

  .trade-access {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
  }

  .product-card {
    align-items: start;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .price-row {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .site-footer address {
    border-left: 0;
    border-top: 1px solid rgba(246, 241, 231, 0.28);
    padding-left: 0;
    padding-top: 18px;
  }
}

@media (max-width: 560px) {
  .site-header,
  main,
  .hero {
    padding: 16px;
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }
}
