:root {
  color-scheme: light;
  --ink: #1c2821;
  --muted: #607067;
  --surface: #ffffff;
  --canvas: #f3f6f2;
  --line: #d4ddd5;
  --line-strong: #aebbb1;
  --primary: #176b4d;
  --primary-dark: #0e4d37;
  --coral: #ad4937;
  --blue: #246aa1;
  --gold: #8a6700;
  --focus: #0f72c5;
  --shadow: 0 12px 30px rgba(21, 45, 31, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  overflow-wrap: anywhere;
}
body.dialog-open { overflow: hidden; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--primary-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.25rem; font-size: 2rem; line-height: 1.15; }
h2 { margin-bottom: 0.5rem; font-size: 1.25rem; line-height: 1.25; }
h3 { margin-bottom: 0.5rem; font-size: 1rem; line-height: 1.3; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: -5rem;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--primary-dark);
  border-radius: 4px;
}
.skip-link:focus { top: 1rem; }

button,
.button {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  font-weight: 700;
}
button:hover { border-color: var(--primary); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.primary {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}
.primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.secondary { color: var(--primary-dark); background: var(--surface); }
.danger { color: var(--coral); border-color: #d7a59c; background: #fff8f6; }
.full-width { width: 100%; }
.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 1.7rem;
  line-height: 1;
}
.icon-button:hover { border-color: var(--line); background: var(--canvas); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 2px;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.7rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: white;
}
textarea { min-height: 78px; resize: vertical; }
label { display: grid; gap: 0.3rem; color: #34443a; font-size: 0.9rem; font-weight: 700; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 0.7rem; font-weight: 800; }

.offline-banner {
  position: sticky;
  z-index: 80;
  top: 0;
  padding: 0.55rem 1rem;
  color: white;
  background: var(--coral);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
}
.offline-banner:not([hidden]) + .site-header { top: 41px; }
.header-main {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(280px, 1.5fr) auto;
  align-items: center;
  gap: 1.25rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}
.brand > span:last-child { display: grid; min-width: 0; }
.brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.brand small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  border-radius: 6px;
  background: var(--primary);
  font-weight: 900;
}
.search-form { display: grid; grid-template-columns: 1fr auto; min-width: 0; }
.search-form input { border-radius: 5px 0 0 5px; }
.search-form button { color: white; border-color: var(--primary); border-radius: 0 5px 5px 0; background: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.header-actions button { min-height: 40px; }
.status-button { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.status-dot.online { background: var(--primary); }
.status-dot.offline { background: var(--coral); }
.cart-button { color: white; border-color: var(--primary); background: var(--primary); }
.advisor-button { color: var(--blue); border-color: #9eb9cc; background: #f4f8fb; }
.cart-button span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  place-items: center;
  color: var(--primary-dark);
  border-radius: 12px;
  background: white;
}
.category-nav {
  display: flex;
  gap: 0.25rem;
  width: min(1500px, 100%);
  min-height: 39px;
  margin: 0 auto;
  padding: 0 1.25rem 0.55rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.category-nav button {
  min-height: 32px;
  padding: 0.28rem 0.65rem;
  border-color: transparent;
  background: transparent;
  font-size: 0.86rem;
  white-space: nowrap;
}
.category-nav button.active { color: var(--primary-dark); border-color: #8dbba8; background: #edf7f1; }

.shop-shell { width: min(1500px, 100%); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.eyebrow { margin-bottom: 0.25rem; color: var(--primary); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.catalog-summary { margin-bottom: 0; color: var(--muted); }
.catalog-actions { display: flex; align-items: end; gap: 0.75rem; }
.catalog-actions label { min-width: 210px; }
.shop-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.filters-panel {
  position: sticky;
  top: 142px;
  display: grid;
  gap: 1.4rem;
  max-height: calc(100vh - 165px);
  padding-right: 1.25rem;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}
.filters-heading { display: flex; align-items: center; justify-content: space-between; }
.filters-heading h2 { margin: 0; }
.check-list { display: grid; gap: 0.45rem; }
.check-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 0.45rem; font-weight: 600; }
.check-row input, .privacy-check input { width: 18px; min-height: 18px; margin: 0; }
.check-count { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.price-range input { min-width: 0; }
.catalog-results { min-width: 0; }
.active-filters { display: flex; min-height: 0; margin-bottom: 0.75rem; gap: 0.4rem; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0.25rem 0.55rem; color: #37473d; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 0.82rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.product-card:hover { border-color: #8eb19d; box-shadow: 0 8px 22px rgba(26, 63, 40, 0.11); transform: translateY(-2px); }
.product-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #e7ede8; touch-action: pan-y; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media img.image-error { object-fit: contain; padding: 2rem; }
.media-controls { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.media-controls button {
  width: 36px;
  min-width: 36px;
  min-height: 42px;
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  font-size: 1.5rem;
  pointer-events: auto;
}
.media-count { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 0.18rem 0.42rem; color: white; border-radius: 3px; background: rgba(18, 31, 23, 0.8); font-size: 0.72rem; }
.stock-badge { position: absolute; top: 0.55rem; left: 0.55rem; padding: 0.24rem 0.5rem; border-radius: 3px; color: #0b4a33; background: #e3f4eb; font-size: 0.72rem; font-weight: 800; }
.stock-badge.order { color: #704f00; background: #fff1bf; }
.product-body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 0.55rem; min-width: 0; padding: 0.85rem; }
.product-meta { margin: 0; color: var(--muted); font-size: 0.78rem; }
.product-title { margin: 0; font-size: 1rem; line-height: 1.3; }
.product-title button { min-height: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.product-title button:hover { color: var(--primary-dark); }
.price-block { align-self: end; }
.price { display: block; font-size: 1.17rem; line-height: 1.2; }
.installments { display: block; min-height: 1.25rem; margin-top: 0.25rem; color: var(--blue); font-size: 0.8rem; }
.product-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 0.45rem; }
.product-actions button { min-width: 0; padding-inline: 0.45rem; font-size: 0.86rem; }
.empty-state { padding: 4rem 1rem; border-top: 1px solid var(--line); text-align: center; }
.product-skeleton { aspect-ratio: 4 / 6.7; border: 1px solid var(--line); border-radius: 6px; background: #e7ece8; animation: pulse 1.3s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 2rem;
  padding: 2rem max(1.25rem, calc((100vw - 1500px) / 2 + 1.25rem));
  color: #eaf2ed;
  background: #20362a;
}
.site-footer p { margin: 0.3rem 0 0; color: #cbd8d0; }
.site-footer nav { display: flex; align-items: start; gap: 0.35rem; flex-wrap: wrap; }
.site-footer button { min-height: 34px; padding: 0.25rem 0.5rem; color: white; border-color: transparent; background: transparent; }
.footer-contact { display: grid; align-content: start; gap: 0.25rem; }
.footer-contact a { color: white; }
dialog {
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 23, 15, 0.58); }
.standard-dialog { width: min(650px, calc(100vw - 2rem)); padding: 1.25rem; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-header h2 { margin: 0; font-size: 1.35rem; }
.dialog-close { position: absolute; z-index: 2; top: 0.6rem; right: 0.6rem; background: rgba(255, 255, 255, 0.92); }
.side-dialog {
  width: min(580px, 100vw);
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0 0 0 auto;
  padding: 1.25rem;
  border-width: 0 0 0 1px;
  border-radius: 0;
  overflow-y: auto;
}
.product-dialog { width: min(940px, calc(100vw - 2rem)); }
.product-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); }
.detail-media { position: relative; min-height: 540px; overflow: hidden; background: #e7ede8; touch-action: pan-y; }
.detail-media img { width: 100%; height: 100%; max-height: 720px; object-fit: cover; }
.detail-info { display: grid; align-content: start; gap: 1rem; padding: 2rem; }
.detail-info h2 { margin: 0; font-size: 1.65rem; }
.detail-description { color: #47584e; white-space: pre-line; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; padding: 0; list-style: none; }
.detail-facts li { padding-bottom: 0.45rem; border-bottom: 1px solid var(--line); }
.detail-facts small { display: block; color: var(--muted); }
.detail-thumbs { display: flex; gap: 0.45rem; overflow-x: auto; }
.detail-thumbs button { width: 62px; min-width: 62px; height: 72px; min-height: 72px; padding: 0; overflow: hidden; }
.detail-thumbs button.active { border: 2px solid var(--primary); }
.detail-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.variant-select { display: grid; gap: 0.35rem; }

.cart-items { display: grid; gap: 0.75rem; }
.cart-empty { padding: 2rem 0; color: var(--muted); text-align: center; }
.cart-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.cart-row img { width: 72px; height: 88px; object-fit: cover; border-radius: 4px; background: #e7ede8; }
.cart-row h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.cart-row p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.quantity-control { display: grid; grid-template-columns: 36px 38px 36px; align-items: center; margin-top: 0.45rem; }
.quantity-control button { min-width: 36px; min-height: 34px; padding: 0; }
.quantity-control output { text-align: center; font-weight: 800; }
.remove-cart { width: 38px; min-width: 38px; padding: 0; color: var(--coral); border-color: transparent; background: transparent; }
.cart-summary { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: 0.9rem 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.checkout-form { padding-top: 0.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-grid .wide { grid-column: 1 / -1; }
.location-row { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; }
.privacy-check { display: grid; grid-template-columns: 20px 1fr; align-items: start; font-weight: 600; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.form-error { padding: 0.65rem; color: #812f21; border-left: 4px solid var(--coral); background: #fff2ef; }
.checkout-form > .primary { margin-top: 1rem; }

.track-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 0.75rem; }
.saved-orders { display: grid; gap: 0.55rem; margin-bottom: 1rem; }
.saved-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.saved-order p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.track-result { margin-top: 1rem; }
.order-status { padding: 0.8rem; border-left: 4px solid var(--blue); background: #f1f7fb; }
.order-status ul { padding-left: 1.1rem; }

.chat-dialog { height: min(720px, calc(100vh - 2rem)); }
.chat-messages { display: grid; align-content: start; gap: 0.7rem; height: min(520px, calc(100vh - 210px)); padding: 0.5rem; overflow-y: auto; background: var(--canvas); }
.chat-message { max-width: 86%; padding: 0.65rem 0.75rem; border-radius: 6px; background: white; white-space: pre-line; }
.chat-message.customer { justify-self: end; color: white; background: var(--primary); }
.chat-message.advisor { justify-self: start; border: 1px solid var(--line); }
.chat-suggestions { display: grid; gap: 0.4rem; margin-top: 0.5rem; }
.chat-suggestion { display: grid; grid-template-columns: 48px 1fr auto; gap: 0.55rem; align-items: center; text-align: left; }
.chat-suggestion img { width: 48px; height: 56px; object-fit: cover; }
.chat-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.6rem; margin-top: 0.75rem; }
.confirmation-dialog { text-align: center; }
.confirmation-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 1rem; place-items: center; color: white; border-radius: 50%; background: var(--primary); font-size: 1.6rem; font-weight: 900; }
.confirmation-dialog code { display: inline-block; padding: 0.3rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--canvas); font-size: 0.92rem; }
.policy-content { color: #3f5146; white-space: pre-line; }
.page-overlay { position: fixed; z-index: 59; inset: 0; background: rgba(10, 23, 15, 0.55); }
.toast-region { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: grid; width: min(380px, calc(100vw - 2rem)); gap: 0.5rem; }
.toast { padding: 0.75rem 0.9rem; color: white; border-radius: 5px; background: #263d30; box-shadow: var(--shadow); }
.toast.error { background: #843426; }
.toast.info { background: var(--blue); }

.mobile-only { display: none; }

@media (max-width: 1080px) {
  .header-main { grid-template-columns: 1fr auto; }
  .search-form { grid-column: 1 / -1; grid-row: 2; }
  .filters-panel { top: 197px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer nav { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  h1 { font-size: 1.65rem; }
  .mobile-only { display: inline-grid; place-items: center; }
  .site-header { position: relative; }
  .offline-banner:not([hidden]) + .site-header { top: 0; }
  .header-main { grid-template-columns: minmax(0, 1fr) auto; gap: 0.65rem; padding: 0.7rem 0.8rem; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .brand small, .status-button { display: none; }
  .header-actions { gap: 0.3rem; }
  .header-actions button { min-height: 38px; padding: 0.45rem 0.55rem; font-size: 0.8rem; }
  .search-form { grid-column: 1 / -1; }
  .category-nav { padding-inline: 0.8rem; }
  .shop-shell { padding: 1rem 0.8rem 3rem; }
  .catalog-heading { align-items: start; }
  .catalog-actions { flex-direction: column; align-items: stretch; }
  .catalog-actions label { min-width: 165px; }
  .shop-layout { display: block; }
  .filters-panel {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(340px, calc(100vw - 2rem));
    max-height: 100vh;
    padding: 1.25rem;
    border: 0;
    background: white;
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }
  body.filters-open .filters-panel { transform: translateX(0); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .product-body { padding: 0.65rem; }
  .product-actions { grid-template-columns: 1fr; }
  .product-actions button { min-height: 38px; }
  .site-footer { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem 1rem; }
  .site-footer nav { grid-column: auto; }
  .product-detail { grid-template-columns: 1fr; }
  .detail-media { min-height: 360px; aspect-ratio: 4 / 5; }
  .detail-info { padding: 1.25rem; }
  .side-dialog { width: 100vw; }
  .form-grid, .track-form { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .location-row { align-items: start; flex-direction: column; }
  .chat-form { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .header-main { grid-template-columns: minmax(0, 1fr); }
  .header-actions { justify-content: stretch; }
  .header-actions button { flex: 1; }
  .brand { justify-content: center; }
  .catalog-heading { display: grid; }
  .catalog-actions { display: grid; grid-template-columns: auto 1fr; }
  .catalog-actions label { min-width: 0; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 42% 58%; grid-template-rows: auto; }
  .product-media { height: 100%; min-height: 250px; aspect-ratio: auto; }
  .media-controls button { width: 30px; min-width: 30px; }
  .product-body { grid-template-rows: auto auto 1fr auto; }
  .product-actions { grid-template-columns: 1fr; }
  .standard-dialog { width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); padding: 1rem; }
  .cart-row { grid-template-columns: 60px minmax(0, 1fr) 36px; }
  .cart-row img { width: 60px; height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
