:root {
  --ink: #1d2922;
  --muted: #68736c;
  --paper: #f7f5ef;
  --card: #fff;
  --green: #2f6147;
  --lime: #d9edce;
  --line: #dedfd7;
  --orange: #c66f2d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
}

.topbar {
  height: 82px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 239, .96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.brand small { color: var(--muted); margin-top: 1px; }

.nav-actions { display: flex; align-items: center; gap: 18px; }
.view-only { font-size: 13px; font-weight: 700; color: var(--green); }
.view-only span { width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: #64a87f; }

.icon-button {
  position: relative;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lock-dot { position: absolute; right: -2px; top: -3px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: white; font-size: 10px; font-weight: 800; border: 2px solid var(--paper); }
.admin-link { height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 0 13px; background: white; color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; }

.hero {
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 44px 8% 48px;
  background: linear-gradient(100deg, #edf2e7 0%, #f7f5ef 72%);
  border-bottom: 1px solid var(--line);
}

.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 68px); line-height: .98; letter-spacing: -.04em; }
h1 em { color: var(--green); font-style: italic; }
.hero-copy { max-width: 520px; margin: 18px 0 0; color: var(--muted); line-height: 1.65; }
.hero-stat { width: 150px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #bbcbb6; border-radius: 50%; background: rgba(255,255,255,.45); }
.hero-stat span { font-family: Georgia, "Times New Roman", serif; font-size: 48px; line-height: 1; }
.hero-stat small { margin-top: 8px; color: var(--muted); }

.catalog { max-width: 1240px; margin: 0 auto; padding: 42px 24px 70px; }
.toolbar { display: flex; gap: 16px; align-items: end; }
.search { flex: 1; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.search svg { width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.filters { display: flex; gap: 10px; }
.filters label, .results-heading label { color: var(--muted); font-size: 12px; font-weight: 700; }
.filters label { display: grid; gap: 5px; }
select { height: 52px; min-width: 150px; padding: 0 38px 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font: inherit; }

.results-heading { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.results-heading p { color: var(--muted); }
.results-heading p strong { color: var(--ink); }
.results-heading label { display: flex; align-items: center; gap: 8px; }
.results-heading select { height: 38px; min-width: 145px; }

.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(40,55,45,.08); }
.product-image { height: 155px; background: #e8e5dc; }
.product-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-top { height: 12px; background: var(--lime); }
.product-card[data-status="limited"] .product-top { background: #ead9a9; }
.product-card[data-status="out"] .product-top { background: #ddd; }
.product-body { padding: 20px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; }
.product-type { margin: 0 0 5px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.product-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.serial { color: var(--muted); font-size: 11px; white-space: nowrap; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; padding: 15px 0; border-top: 1px solid #ecece6; border-bottom: 1px solid #ecece6; }
.spec small, .spec strong { display: block; }
.spec small { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.spec strong { font-size: 14px; }
.card-bottom { display: flex; align-items: end; justify-content: space-between; }
.price small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
.price strong { font-family: Georgia, "Times New Roman", serif; font-size: 24px; }
.original-price { margin-left: 5px; color: var(--muted); font-size: 12px; text-decoration: line-through; }
.discount { display: block; margin-top: 4px; color: #94701e; font-size: 11px; font-weight: 800; }
.status { padding: 7px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status.in { color: #286b47; background: #e0efdf; }
.status.limited { color: #865d1d; background: #f4eccd; }
.status.out { color: #737973; background: #eceeea; }
.add-cart { width: 100%; height: 42px; margin-top: 16px; border: 0; border-radius: 7px; background: var(--green); color: white; font: 700 13px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.add-cart:disabled { background: #cfd3cf; cursor: not-allowed; }

.cart-drawer { position: fixed; z-index: 12; right: 0; top: 0; width: min(390px, 92vw); height: 100vh; padding: 26px; background: white; box-shadow: -20px 0 50px rgba(27,40,31,.16); transform: translateX(102%); transition: transform .25s ease; }
.cart-drawer.open { transform: translateX(0); }
.drawer-shade { position: fixed; z-index: 11; inset: 0; background: rgba(21,31,24,.35); }
.cart-header { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.cart-header h2 { margin: 0 0 18px; font-family: Georgia, "Times New Roman", serif; }
.cart-header .modal-close { position: static; }
.cart-empty { padding: 50px 10px; color: var(--muted); text-align: center; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #ecece6; }
.cart-item img { width: 72px; height: 62px; border-radius: 6px; object-fit: cover; }
.cart-item-info strong, .cart-item-info small { display: block; }
.cart-item-info small { margin-top: 5px; color: var(--muted); }
.cart-controls { display: flex; align-items: center; gap: 7px; }
.cart-controls button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; }
.cart-controls button:disabled { color: #adb4ae; background: #f1f2ef; cursor: not-allowed; }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-state h2 { font-family: Georgia, "Times New Roman", serif; }
.catalog-error { padding: 18px; border: 1px solid #e6b9b1; border-radius: 8px; background: #fff1ed; color: #8a332a; }
.business-contact { max-width: 1240px; margin: 0 auto; padding: 30px 24px; border-top: 1px solid var(--line); }
.business-contact h2 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; }
.business-contact address { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-style: normal; line-height: 1.6; }
.business-contact address p { margin: 0; white-space: pre-line; }
.business-contact a { width: fit-content; color: var(--green); text-decoration: none; }
.contact-error { max-width: 1240px; margin: 0 auto 20px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(21,31,24,.45); backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(420px, 100%); position: relative; padding: 34px; border-radius: 14px; background: white; text-align: center; box-shadow: 0 24px 60px rgba(20,30,23,.25); }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.modal-icon { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: #eef1e8; }
.modal-icon svg { width: 28px; fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.modal h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.modal p { color: var(--muted); line-height: 1.6; }
.primary-button { width: 100%; height: 46px; margin-top: 8px; border: 0; border-radius: 7px; background: var(--green); color: white; font: 700 14px "Segoe UI", Arial, sans-serif; cursor: pointer; }

footer { min-height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 5%; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.admin-body { min-height: 100vh; }
.admin-shell { min-height: calc(100vh - 82px); display: grid; place-items: center; padding: 40px 20px; }
.login-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.login-card h1 { font-size: 38px; }
.install-hint { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-card label, .editor-modal label { display: grid; gap: 7px; margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-card input, .editor-modal input, .editor-modal select { height: 46px; width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; color: var(--ink); background: white; font: inherit; }
.login-error, .save-status { min-height: 18px; color: #b13d34; font-size: 12px; }
.demo-logins { display: grid; gap: 7px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.demo-logins strong { color: var(--ink); }
.admin-actions { display: flex; align-items: center; gap: 10px; }
.secondary-button { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); font: 700 13px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.secondary-button:disabled { opacity: .6; cursor: wait; }
.backup-note { margin: -8px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.save-status.error { color: #b13d34; }
.admin-dashboard { grid-template-columns: 220px minmax(0, 1200px); place-items: stretch; align-items: start; gap: 24px; max-width: 1450px; margin: 0 auto; }
.admin-sidebar { min-height: 520px; padding: 26px 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.admin-sidebar h2 { margin: 0 0 24px; font-family: Georgia, "Times New Roman", serif; }
.admin-nav { width: 100%; height: 42px; margin: 4px 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; padding: 0 12px; font: 700 13px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.admin-nav.active { background: #edf2e7; color: var(--green); }
.admin-content { min-width: 0; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-heading h1 { font-size: 42px; }
.compact { width: auto; margin: 0; padding: 0 16px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: white; }
.site-settings-card { margin-top: 26px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.site-settings-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.site-settings-card .backup-note { margin: 10px 0 14px; }
.site-settings-card label { display: grid; gap: 7px; margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.site-settings-card input, .site-settings-card textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 12px; color: var(--ink); background: white; font: inherit; }
.site-settings-card input { height: 46px; }
.site-settings-card textarea { resize: vertical; }
.site-settings-card .primary-button { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { min-width: 110px; padding: 13px 12px; border-bottom: 1px solid #ecece6; text-align: left; font-size: 12px; }
th { color: var(--muted); background: #fafaf7; }
td strong { display: block; }
.table-image { width: 58px; height: 42px; border-radius: 5px; object-fit: cover; }
.table-edit { border: 1px solid var(--line); border-radius: 6px; background: white; padding: 7px 9px; color: var(--green); font-weight: 700; cursor: pointer; }
.editor-modal { position: relative; width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 30px; border-radius: 12px; background: white; }
.editor-modal h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.editor-modal .modal-close { position: absolute; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.full-field { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stat { width: 120px; height: 120px; }
}

@media (max-width: 680px) {
  .topbar { height: 70px; }
  .view-only { display: none; }
  .hero { min-height: 300px; align-items: flex-end; padding: 36px 24px; }
  .hero-stat { display: none; }
  .catalog { padding: 28px 16px 50px; }
  .toolbar { display: grid; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters label { min-width: 0; }
  .filters select { width: 100%; min-width: 0; }
  .product-grid { grid-template-columns: 1fr; }
  .results-heading { height: 62px; }
  .results-heading select { min-width: 130px; }
  .admin-dashboard { display: block; padding: 18px 12px; }
  .admin-sidebar { min-height: 0; margin-bottom: 20px; }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .admin-heading h1 { font-size: 36px; }
  .admin-actions { width: 100%; }
  .admin-actions button { flex: 1; padding: 0 8px; font-size: 11px; }
  .site-settings-card { padding: 18px; }
  .editor-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  footer { gap: 10px; align-items: flex-start; flex-direction: column; justify-content: center; }
}
