:root {
  --primary: #82ae46;
  --button: #82ae46;
  --button-text: #ffffff;
  --header: #ffffff;
  --cart: #82ae46;
  --ink: #14210f;
  --muted: #677263;
  --soft: #f6f9f2;
  --line: #e2eadb;
  --danger: #c0392b;
  --shadow: 0 18px 45px rgba(18, 34, 10, .10);
  --logo-width: 150px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfdf8;
  font-family: Arial, Helvetica, sans-serif;
}

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

img {
  display: block;
  max-width: 100%;
}

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.narrow {
  max-width: 820px;
  padding: 34px 0;
}

.top-promo {
  background: var(--primary);
  color: #fff;
  padding: 9px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 78px;
  padding: 12px max(18px, calc((100vw - 1180px) / 2));
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 24px;
  font-weight: 900;
}

.logo img {
  width: var(--logo-width);
  max-width: 320px;
  max-height: 66px;
  object-fit: contain;
}

.logo span {
  white-space: nowrap;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
}

.top-links a:not(.cart-pill):hover,
.category-strip a:hover {
  color: var(--primary);
}

.cart-pill,
.floating-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--cart);
  color: #fff;
  font-weight: 900;
}

.cart-pill strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  color: var(--cart);
  background: #fff;
  border-radius: 999px;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
  font-weight: 800;
}

.category-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.category-strip a {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f2f5ef;
  font-weight: 800;
}

.premium-slider {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  background: #edf4e8;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transition: opacity .45s ease;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.58), rgba(255,255,255,.18));
}

.slide.active {
  opacity: 1;
}

.slide-content {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 32px));
  margin-left: max(18px, calc((100vw - 1180px) / 2));
}

.slide-content span,
.section-title span {
  color: var(--primary);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.slide-content h1 {
  margin: 12px 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
}

.slide-content p {
  max-width: 520px;
  color: #42503b;
  font-size: 20px;
  line-height: 1.55;
}

.slider-dots {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 2;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

.slider-dots button {
  width: 13px;
  height: 13px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 33, 15, .25);
}

.slider-dots button.active {
  width: 34px;
  background: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font-weight: 900;
  cursor: pointer;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn.muted {
  color: var(--ink);
  background: #eef4e9;
}

.quick-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: -42px;
  position: relative;
  z-index: 4;
}

.quick-bar div,
.campaign-card,
.category-card,
.product-card,
.form-card,
.settings-section,
.order-card,
.stat,
.cart-item,
.empty,
.alert {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 34, 10, .05);
}

.quick-bar div {
  padding: 20px;
  border-radius: 18px;
}

.quick-bar b {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.quick-bar span,
.section-title span,
.stock,
.help-text,
small {
  color: var(--muted);
}

.campaigns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 54px 0 26px;
}

.campaign-card {
  min-height: 230px;
  padding: 28px;
  border-radius: 18px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  position: relative;
}

.campaign-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.48));
}

.campaign-card > * {
  position: relative;
  z-index: 1;
}

.campaign-card span {
  color: var(--primary);
  font-weight: 900;
}

.campaign-card h2 {
  margin: 10px 0;
  font-size: 30px;
}

.section-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  margin: 34px 0 18px;
}

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

.category-grid,
.product-grid,
.product-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
  padding-bottom: 0;
}

.category-card {
  overflow: hidden;
  border-radius: 16px;
}

.category-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.category-card strong {
  display: block;
  padding: 14px 16px;
  font-size: 18px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.product-card img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  padding: 18px;
  background: #fff;
}

.product-info {
  display: grid;
  grid-template-rows: minmax(44px, auto) 24px 68px 32px 48px 48px;
  gap: 10px;
  flex: 1;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.product-info h3 {
  min-height: 44px;
  margin: 0;
  font-size: 17px;
}

.price-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.price-line strong {
  color: var(--primary);
  font-size: 20px;
}

.price-line del {
  color: #8a9285;
}

.discount-badge,
.stock-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.stock-badge {
  left: auto;
  right: 14px;
  background: #f39c12;
}

.product-qty,
.qty-form,
.drawer-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-qty {
  width: 100%;
  min-height: 48px;
}

.product-qty button,
.qty-form button,
.drawer-qty button {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.product-qty input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  font-weight: 900;
}

.more-btn {
  margin: 28px auto 0;
}

.site-footer {
  margin-top: 60px;
  padding: 38px 16px;
  text-align: center;
  color: #eaf4df;
  background: #213915;
}

.site-footer strong {
  display: block;
  margin-bottom: 10px;
  font-size: 24px;
}

.site-footer div {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.floating-cart {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 24;
  box-shadow: var(--shadow);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(0,0,0,.32);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(430px, 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 50px rgba(0,0,0,.18);
  transform: translateX(105%);
  transition: transform .25s ease;
}

body.cart-open .drawer-backdrop {
  display: block;
}

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

.drawer-head,
.drawer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head button {
  border: 0;
  background: transparent;
  font-size: 34px;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.drawer-item,
.cart-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
}

.drawer-item + .drawer-item,
.cart-item + .cart-item {
  margin-top: 12px;
}

.drawer-item img,
.cart-item img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 12px;
  background: #f7faf4;
}

.drawer-item strong,
.cart-item strong,
.cart-item span {
  display: block;
}

.drawer-item em {
  white-space: nowrap;
  font-style: normal;
}

.drawer-empty,
.empty {
  padding: 22px;
  border-radius: 16px;
  text-align: center;
}

.drawer-summary {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: 20px;
  font-weight: 900;
}

.checkout-btn {
  margin: 0 20px 20px;
}

.cart-list {
  display: grid;
  gap: 14px;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 22px;
  font-weight: 900;
}

.form-card,
.settings-section {
  border-radius: 18px;
  padding: 22px;
}

.form-card,
.admin-form,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  align-items: start;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(130, 174, 70, .14);
}

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

input[type="color"] {
  padding: 5px;
}

input[type="file"] {
  padding: 8px;
  background: #fff;
}

.wide {
  grid-column: 1 / -1;
}

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

.check input {
  width: auto;
  min-height: 0;
}

.alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #335d19;
  background: #f1f8ea;
}

.alert.error {
  color: #8f1d12;
  background: #fff0ed;
  border-color: #ffc8bd;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(140deg, #f4f9ef, #ffffff);
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: #fbfdf8;
}

.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 18px;
  color: #edf7e6;
  background: #1d3710;
}

.admin-side h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 24px;
}

.admin-side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  font-weight: 900;
}

.admin-side a:hover {
  background: rgba(255,255,255,.12);
}

.badge {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e74c3c;
  color: #fff;
  text-align: center;
}

.admin-main {
  min-width: 0;
  max-width: 100%;
  padding: 34px;
  overflow-x: hidden;
}

.admin-main h1 {
  margin: 0 0 22px;
  font-size: 34px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat {
  padding: 22px;
  border-radius: 18px;
}

.stat strong {
  display: block;
  color: var(--primary);
  font-size: 38px;
}

.admin-table {
  width: 100%;
  margin-top: 22px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 34, 10, .05);
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f2f7ed;
}

.admin-table a {
  color: var(--primary);
  font-weight: 900;
}

.settings-page {
  display: grid;
  gap: 22px;
  max-width: 100%;
}

.settings-section {
  box-shadow: 0 12px 34px rgba(18, 34, 10, .05);
}

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

.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.settings-box {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdf8;
}

.settings-box h3 {
  margin: 0;
  font-size: 20px;
}

.settings-save {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 16px 0 2px;
  background: linear-gradient(rgba(251,253,248,.88), #fbfdf8);
}

.help-text {
  margin: -4px 0 16px;
  line-height: 1.5;
}

.variant-label {
  font-size: 13px;
  min-height: 68px;
  align-content: end;
}

.variant-label select {
  min-height: 42px;
}

.variant-spacer {
  min-height: 68px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.status-line strong {
  color: var(--primary);
}

.status-line.closed strong {
  color: var(--danger);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.checkout-page {
  max-width: 1120px;
}

.checkout-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-summary,
.track-result {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 34, 10, .05);
}

.checkout-summary h2,
.track-result h2 {
  margin-top: 0;
}

.checkout-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 18px;
  padding: 9px 0;
}

.checkout-summary span {
  min-width: 0;
  line-height: 1.35;
}

.checkout-summary strong {
  min-width: 92px;
  text-align: right;
  white-space: nowrap;
}

.checkout-summary hr {
  border: 0;
  border-top: 1px solid var(--line);
}

.checkout-summary .grand {
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  gap: 18px;
  font-size: 23px;
  font-weight: 900;
}

.checkout-summary .grand span,
.checkout-summary .grand strong {
  white-space: nowrap;
}

.success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0;
}

.track-form {
  margin-bottom: 18px;
}

.status-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.status-steps span {
  padding: 12px 10px;
  border-radius: 12px;
  background: #eef4e9;
  text-align: center;
  font-weight: 900;
}

.status-steps span.active {
  background: var(--primary);
  color: #fff;
}

.mini-link {
  display: inline-flex;
  margin-left: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9f6df;
  color: #335d19;
  font-size: 12px;
  font-weight: 900;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.admin-table.compact {
  margin-top: 8px;
}

.low-stock-row td,
.low-stock-row {
  background: #fff7e8;
}

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

.order-card {
  padding: 18px;
  border-radius: 18px;
}

.order-card.unseen {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(130,174,70,.12), 0 12px 34px rgba(18,34,10,.06);
}

.order-head,
.order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-head strong {
  font-size: 20px;
}

.order-head span {
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.order-actions select {
  width: min(260px, 100%);
}

@media (max-width: 980px) {
  .top-links {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  body.menu-open .top-links {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .premium-slider {
    min-height: 470px;
  }

  .quick-bar,
  .campaigns,
  .category-grid,
  .product-grid,
  .product-row,
  .checkout-layout,
  .admin-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .admin-side h2 {
    width: 100%;
    margin-bottom: 6px;
  }

  .admin-main {
    padding: 22px 16px;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 68px;
  }

  .logo span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .slide-content h1 {
    font-size: 38px;
  }

  .quick-bar,
  .campaigns,
  .category-grid,
  .product-grid,
  .product-row,
  .form-card,
  .admin-form,
  .checkout-form,
  .checkout-layout,
  .admin-dashboard,
  .status-steps,
  .settings-grid,
  .settings-cards {
    grid-template-columns: 1fr;
  }

  .drawer-item,
  .cart-item {
    grid-template-columns: 70px 1fr;
  }

  .drawer-item em,
  .cart-item > strong {
    grid-column: 1 / -1;
  }

  .floating-cart {
    left: 16px;
    right: 16px;
  }
}
