@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --forest: #24402F;
  --forest-dark: #172A1F;
  --gold: #D9A441;
  --clay: #A8552E;
  --sand: #EFE6D0;
  --sand-light: #F8F3E6;
  --charcoal: #241F18;
  --line: rgba(36, 31, 24, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sand-light);
  color: var(--charcoal);
  font-family: 'Work Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- Header ---------- */
header.site-header {
  background: var(--forest);
  color: var(--sand-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  color: var(--sand-light);
  white-space: nowrap;
}

.brand svg { flex-shrink: 0; }

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

.menu-toggle {
  background: none;
  border: none;
  color: var(--sand-light);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 42, 31, 0.5);
  z-index: 80;
}

.account-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 80vw;
  height: 100%;
  background: var(--sand-light);
  z-index: 81;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(23,42,31,0.3);
}

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

.drawer-header {
  background: var(--forest);
  color: var(--sand-light);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header button {
  background: none;
  border: none;
  color: var(--sand-light);
  font-size: 18px;
  cursor: pointer;
}

.drawer-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.drawer-section a, .drawer-link-btn {
  padding: 12px 16px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
  width: 100%;
}

.drawer-section a:hover, .drawer-link-btn:hover {
  background: var(--sand);
}

.drawer-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(36,31,24,0.5);
}

.drawer-see-all {
  color: var(--clay);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.drawer-category-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 14px;
}

.drawer-category-link:hover {
  background: var(--sand);
}

.search-form {
  display: flex;
  width: 100%;
}

.search-form input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 4px 0 0 4px;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
  min-width: 0;
}

.search-form button {
  background: var(--gold);
  color: var(--forest-dark);
  border: none;
  padding: 0 16px;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-account {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(248, 243, 230, 0.85);
}

.header-account a { text-decoration: underline; }
.header-account a:hover { color: var(--gold); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(248, 243, 230, 0.85);
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Work Sans', sans-serif;
}
.link-btn:hover { color: var(--gold); }

.cart-badge {
  background: var(--gold);
  color: var(--forest-dark);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

nav.category-nav {
  background: var(--forest-dark);
  overflow-x: auto;
}

nav.category-nav .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

nav.category-nav a {
  display: inline-block;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--sand);
  border-bottom: 2px solid transparent;
}

nav.category-nav a:hover,
nav.category-nav a.active {
  border-bottom-color: var(--gold);
  color: var(--sand-light);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--forest);
  color: var(--sand-light);
  padding: 56px 24px 72px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 12px 0 16px;
  max-width: 720px;
}

.hero p {
  max-width: 520px;
  color: rgba(248, 243, 230, 0.85);
  font-size: 17px;
}

.hero-tree {
  position: absolute;
  right: -40px;
  bottom: -20px;
  opacity: 0.16;
  z-index: 1;
}

/* ---------- Category chips on homepage ---------- */
.cat-chips {
  max-width: 1200px;
  margin: -36px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 3;
}

.cat-chip {
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 20px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(23, 42, 31, 0.12);
}

.cat-chip:hover { border-color: var(--gold); }

.banner-row {
  display: flex;
  gap: 12px;
}

.banner-row > img.banner-image {
  flex: 1;
  min-width: 0;
}

.banner-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.banner-link {
  flex: 1;
  min-width: 0;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

@media (min-width: 640px) {
  .banner-image { aspect-ratio: 4 / 3; }
}

/* ---------- Product grid ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-title h2 { font-size: 26px; margin: 0; }

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

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

.scroll-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.scroll-item {
  flex: 0 0 150px;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .scroll-item { flex-basis: 200px; }
}

.product-card {
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(23, 42, 31, 0.14);
}

.wishlist-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

.wishlist-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(248, 243, 230, 0.9);
  color: var(--clay);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 42, 31, 0.2);
}

.wishlist-btn-active {
  background: var(--clay);
  color: var(--sand-light);
}

.product-image {
  aspect-ratio: 1 / 1;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  font-size: 13px;
  overflow: hidden;
  position: relative;
}

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

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--clay);
  color: var(--sand-light);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  z-index: 2;
}

.sale-price {
  color: var(--clay);
  font-weight: 600;
}

.was-price {
  text-decoration: line-through;
  color: rgba(36,31,24,0.45);
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}

.cat-icon {
  width: 44%;
  height: 44%;
  color: var(--forest);
  opacity: 0.55;
}

.image-wrap-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrap-icon .cat-icon {
  width: 30%;
  height: 30%;
}

.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

.product-body h3 { font-size: 14px; margin: 0; line-height: 1.3; }

.product-benefit {
  font-size: 12px;
  color: rgba(36,31,24,0.65);
  flex: 1;
}

.price-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  color: var(--clay);
  font-size: 14px;
}

.btn {
  display: inline-block;
  background: var(--forest);
  color: var(--sand-light);
  border: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}

.product-card .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .product-body { padding: 14px 16px 16px; gap: 6px; }
  .product-body h3 { font-size: 16px; }
  .product-benefit { font-size: 13px; }
  .price-tag { font-size: 15px; }
  .btn { padding: 10px 16px; font-size: 14px; }
}

.btn:hover { background: var(--forest-dark); }

.btn-gold { background: var(--gold); color: var(--forest-dark); }
.btn-gold:hover { background: #c99334; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--forest);
  color: var(--forest);
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
}

.product-detail .image-wrap {
  aspect-ratio: 1/1;
  background: var(--sand);
  border-radius: 12px;
  overflow: hidden;
}
.product-detail .image-wrap img { width: 100%; height: 100%; object-fit: cover; }

.product-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.product-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.65;
}

.product-thumbnail.active {
  border-color: var(--gold);
  opacity: 1;
}
.benefit-box {
  background: var(--sand);
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  border-radius: 4px;
  margin: 16px 0;
  font-size: 14px;
}

/* ---------- Cart / checkout ---------- */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cart-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.cart-table th, .cart-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.cart-table input[type=number] { width: 60px; padding: 6px; }
.summary-box {
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  max-width: 340px;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: 'Work Sans', sans-serif;
  font-size: 14px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  color: rgba(36,31,24,0.5);
  line-height: 1;
}

.alert-error {
  background: #FBE4DA;
  color: var(--clay);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: #E4EEE2;
  color: var(--forest-dark);
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--forest-dark);
  color: rgba(248,243,230,0.7);
  padding: 32px 24px;
  margin-top: 48px;
  font-size: 13px;
  text-align: center;
}

footer.site-footer a { color: var(--gold); }

.back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--forest);
  color: var(--sand-light);
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(23, 42, 31, 0.3);
  z-index: 40;
}

.back-to-top:hover { background: var(--forest-dark); }

/* ---------- Admin ---------- */
.admin-shell { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.admin-card {
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat {
  background: var(--forest);
  color: var(--sand-light);
  border-radius: 10px;
  padding: 18px 22px;
  min-width: 140px;
}
.stat .num { font-family: 'Fraunces', serif; font-size: 30px; }
.stat .label { font-size: 12px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: rgba(36,31,24,0.6);
}

/* ---------- Order tracking ---------- */
.tracking-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 8px 0 4px;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.tracking-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.tracking-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sand-light);
  border: 2px solid var(--line);
  margin-bottom: 8px;
}

.tracking-step.active .tracking-dot {
  background: var(--forest);
  border-color: var(--forest);
}

.tracking-label {
  font-size: 12px;
  text-align: center;
  color: rgba(36,31,24,0.6);
  max-width: 100px;
}

.tracking-step.active .tracking-label {
  color: var(--forest);
  font-weight: 600;
}

/* ---------- Reviews & ratings ---------- */
.stars-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px;
}

.seller-tag {
  font-size: 12px;
  color: rgba(36,31,24,0.55);
  margin-bottom: 2px;
}

.stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}

.review-count {
  font-size: 12px;
  color: rgba(36,31,24,0.6);
}

.review-item {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.review-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.review-comment {
  margin: 6px 0 4px;
  font-size: 14px;
}

.review-date {
  font-size: 12px;
  color: rgba(36,31,24,0.5);
  margin: 0;
}
/* ---------- Chat widget ---------- */
.chat-bubble {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--forest-dark);
  border: none;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(23, 42, 31, 0.3);
  z-index: 60;
}

.chat-panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 320px;
  max-width: calc(100vw - 40px);
  height: 440px;
  max-height: calc(100vh - 100px);
  background: var(--sand-light);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(23, 42, 31, 0.25);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--forest);
  color: var(--sand-light);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}

.chat-header button {
  background: none;
  border: none;
  color: var(--sand-light);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-msg-assistant {
  background: var(--sand);
  color: var(--charcoal);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-msg-user {
  background: var(--forest);
  color: var(--sand-light);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-msg-typing {
  opacity: 0.6;
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-input-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Work Sans', sans-serif;
}

.chat-send-btn {
  background: var(--gold);
  color: var(--forest-dark);
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
/* ---------- Cookie notice banner ---------- */
.cookie-banner {
  background: var(--forest-dark);
  color: var(--sand-light);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  position: relative;
  z-index: 70;
}
