:root {
  --green: #1F3A2E;
  --green-deep: #152820;
  --stone: #E8E2D8;
  --stone-dark: #D4CBBE;
  --brass: #A68B5B;
  --brass-soft: #C4A574;
  --ink: #1A1A17;
  --muted: #5C5A54;
  --white: #FBF9F6;
  --line: rgba(31, 58, 46, 0.14);
  --shadow: 0 18px 50px rgba(21, 40, 32, 0.12);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --max: 1180px;
  --radius: 4px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(166, 139, 91, 0.12), transparent 55%),
    linear-gradient(180deg, #F7F3EC 0%, var(--white) 28%, #F3EEE6 100%);
  min-height: 100vh;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brass); }
h1, h2, h3, .brand-text {
  font-family: var(--font-display);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 249, 246, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transform: translateY(0);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 28px rgba(21, 40, 32, 0.08); }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: var(--green); }

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--green);
}
.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
}
.brand-text {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 560;
  font-size: 0.98rem;
}
.nav-links a:hover { color: var(--green); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.cart-link {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 0.75rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover { background: var(--green-deep); color: var(--white); }
.btn-secondary {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}
.btn-secondary:hover { background: var(--green); color: var(--white); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-sm { padding: 0.5rem 0.85rem; font-size: 0.92rem; }
.btn-block { width: 100%; }

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(110deg, rgba(21, 40, 32, 0.82) 12%, rgba(21, 40, 32, 0.35) 55%, rgba(21, 40, 32, 0.15) 100%),
    radial-gradient(circle at 70% 40%, rgba(166, 139, 91, 0.35), transparent 45%),
    linear-gradient(160deg, #2c4a3c, #1a2e25 55%, #3d3428);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 5rem 0 4rem;
  max-width: 36rem;
  animation: rise 0.9s ease both;
}
.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.04em;
}
.hero h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 450;
  margin: 0 0 0.85rem;
  color: rgba(251, 249, 246, 0.95);
}
.hero p {
  margin: 0 0 1.6rem;
  font-size: 1.12rem;
  color: rgba(251, 249, 246, 0.82);
  max-width: 30rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .btn-primary { background: var(--brass); color: var(--green-deep); }
.hero .btn-primary:hover { background: var(--brass-soft); color: var(--green-deep); }
.hero .btn-secondary { border-color: rgba(255,255,255,0.55); color: var(--white); }
.hero .btn-secondary:hover { background: rgba(255,255,255,0.12); color: var(--white); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section { padding: 4.5rem 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.section-head h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { margin: 0.35rem 0 0; color: var(--muted); }

.category-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.category-link {
  display: block;
  padding: 1.6rem 1.3rem;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.category-link:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  background: #fff;
  color: var(--green);
}
.category-link strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  group: true;
}
.product-card .thumb {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--stone);
  aspect-ratio: 4 / 3;
}
.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .meta { padding: 0.85rem 0.1rem 0; }
.product-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-family: var(--font-body);
  font-weight: 650;
}
.product-card .price {
  color: var(--green);
  font-weight: 700;
}
.product-card .cat {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

/* Catalog layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  padding: 2.5rem 0 4rem;
}
.filters {
  padding: 1.2rem;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: fit-content;
  position: sticky;
  top: 6.5rem;
}
.filters h2 {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
}
.filters ul { list-style: none; margin: 0; padding: 0; }
.filters li { margin: 0.35rem 0; }
.filters a {
  text-decoration: none;
  color: var(--muted);
}
.filters a.active,
.filters a:hover { color: var(--green); font-weight: 650; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.toolbar select,
.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.form label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}
.form .field { margin-bottom: 1rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.page-title {
  padding: 2.2rem 0 0.5rem;
}
.page-title h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); }
.breadcrumb {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.breadcrumb a { color: inherit; text-decoration: none; }

/* Product page */
.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  padding: 2rem 0 4rem;
}
.gallery-main {
  background: var(--stone);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail h1 { margin: 0 0 0.6rem; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.product-detail .price-lg {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 1rem;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.swatch {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}
.swatch input { display: none; }
.swatch:has(input:checked),
.swatch.is-active {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}
.dims {
  white-space: pre-line;
  color: var(--muted);
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  padding: 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Cart / tables */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius);
}
.qty-input { width: 4.5rem; padding: 0.4rem; }
.summary-box {
  padding: 1.25rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.summary-box dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 1rem;
  margin: 0 0 1rem;
}
.summary-box dt { color: var(--muted); }
.summary-box dd { margin: 0; font-weight: 650; text-align: right; }
.summary-box .total dd { font-size: 1.2rem; color: var(--green); }

.alerts { margin: 1rem 0; }
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
}
.alert-success { background: #e4efe8; color: var(--green-deep); }
.alert-error { background: #f3e2e0; color: #7a2e24; }
.alert-info { background: #efe8d8; color: #5c4a28; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
}
.pagination a,
.pagination span {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}
.pagination .current {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  background: var(--green-deep);
  color: rgba(251, 249, 246, 0.86);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.site-footer a { color: rgba(251, 249, 246, 0.9); text-decoration: none; }
.site-footer a:hover { color: var(--brass-soft); }
.site-footer h3 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  color: var(--white);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.35rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1rem;
  font-size: 0.9rem;
  color: rgba(251, 249, 246, 0.65);
}

.account-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.panel {
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.auth-wrap {
  max-width: 440px;
  margin: 2.5rem auto 4rem;
}

@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-detail { grid-template-columns: 1fr; }
  .category-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links,
  .nav-actions.desktop-only { display: none; }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--white);
    padding: 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .topbar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
}
