:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #637083;
  --line: #dce3ee;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --blue: #2563eb;
  --orange: #ea580c;
  --topbar: rgba(246, 248, 251, 0.88);
  --soft: #e8eef6;
  --soft-hover: #dbe5f1;
  --input: #ffffff;
  --danger-soft: #fee2e2;
  --danger-ink: #991b1b;
  --hero-image: url("/assets/peru-doxer-banner.png");
  --shadow: 0 18px 55px rgba(23, 32, 51, 0.14);
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #182235;
  --ink: #f8fafc;
  --muted: #a9b5c7;
  --line: #2d3a50;
  --accent: #2dd4bf;
  --accent-dark: #14b8a6;
  --blue: #60a5fa;
  --orange: #fb923c;
  --topbar: rgba(15, 23, 42, 0.9);
  --soft: #253149;
  --soft-hover: #31405d;
  --input: #111827;
  --danger-soft: #3b1d22;
  --danger-ink: #fecaca;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: var(--topbar);
  border-bottom: 1px solid rgba(220, 227, 238, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  overflow: hidden;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav button {
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
}

.nav button:hover {
  background: var(--soft);
  color: var(--ink);
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.cart-icon,
.search-icon,
.close-icon,
.theme-icon {
  position: relative;
  display: block;
}

.theme-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.theme-toggle {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.sun-icon {
  display: none;
}

body[data-theme="dark"] .moon-icon {
  display: none;
}

body[data-theme="dark"] .sun-icon {
  display: block;
}

.cart-icon {
  width: 20px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px 2px 5px 5px;
}

.cart-icon::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.close-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 700px);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  min-height: min(700px, calc(100vh - 92px));
  padding: clamp(42px, 7vw, 82px) 0 clamp(34px, 5vw, 58px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px max(-56px, calc((100vw - 1180px) / -2)) 18px;
  z-index: -2;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(15, 23, 42, 0.84) 43%, rgba(15, 23, 42, 0.42) 68%, rgba(15, 23, 42, 0.18) 100%),
    var(--hero-image) center / cover no-repeat;
}

body[data-theme="light"] .hero::before {
  background:
    linear-gradient(90deg, rgba(246, 248, 251, 0.98) 0%, rgba(246, 248, 251, 0.88) 45%, rgba(246, 248, 251, 0.5) 70%, rgba(246, 248, 251, 0.2) 100%),
    var(--hero-image) center / cover no-repeat;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
}

.hero-copy p:not(.eyebrow) {
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.6;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.trust-strip article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  padding: 18px;
}

.trust-strip h3,
.trust-strip p {
  margin: 0;
}

.trust-strip h3 {
  font-size: 16px;
}

.trust-strip p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 4px;
}

.trust-icon {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent);
}

.shield-icon::before,
.check-icon::before {
  content: "";
  width: 18px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 12px 12px;
}

.speed-icon::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.speed-icon::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 2px;
  background: currentColor;
  transform: rotate(-35deg) translate(3px, 2px);
}

.check-icon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 7px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg);
}

.how-pay {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin: 18px 0 0;
}

.how-panel,
.payment-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.how-panel {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: center;
}

.how-panel h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.steps-list {
  display: grid;
  gap: 10px;
}

.steps-list article {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.steps-list span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.steps-list p,
.payment-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.payment-panel {
  display: grid;
  align-content: center;
  gap: 14px;
}

.payment-panel p {
  color: var(--ink);
  font-weight: 900;
}

.payment-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pay-chip {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(87, 20, 62, 0.62), rgba(37, 49, 73, 0.78));
  color: #f8fafc;
  padding: 10px 14px 10px 48px;
}

.pay-chip::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--chip-color, #2563eb);
}

.pay-chip::after {
  content: "";
  position: absolute;
  left: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
}

.bcp-chip {
  --chip-color: #0947c6;
}

.yape-chip {
  --chip-color: #7c1bb3;
}

.agora-chip {
  --chip-color: #08b8f0;
}

.dale-chip {
  --chip-color: #020617;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions,
.form-actions,
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-link,
.secondary-link,
.whatsapp-btn,
.telegram-btn,
.danger-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  padding: 11px 16px;
}

.primary-link {
  background: var(--accent);
  color: #fff;
}

.primary-link:hover {
  background: var(--accent-dark);
}

.secondary-link {
  background: var(--soft);
  color: var(--ink);
}

.secondary-link:hover {
  background: var(--soft-hover);
}

.hero-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.hero-panel div:last-child {
  border-bottom: 0;
}

.hero-panel span {
  color: var(--muted);
}

.hero-panel strong {
  text-align: right;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-wrap {
  position: relative;
}

.search-wrap input,
.admin-form input,
.admin-form select,
.admin-form textarea,
.checkout-form input,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  outline: 0;
  padding: 12px 13px;
}

.search-wrap input {
  padding-left: 42px;
}

.search-wrap input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.checkout-form input:focus,
.checkout-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.admin-form input[type="file"] {
  padding: 10px;
}

.admin-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 15px;
  height: 15px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-50%);
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.category-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
}

.category-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body[data-theme="dark"] .category-tabs button.active {
  color: #06231f;
}

.section-heading,
.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 42px 0 18px;
}

.section-heading h2,
.admin-header h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

#productCounter {
  color: var(--muted);
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-height: 280px;
}

.product-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
}

.product-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.product-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.product-meta h3 {
  margin: 0;
  font-size: 18px;
}

.price {
  color: var(--accent-dark);
  font-weight: 900;
  white-space: nowrap;
}

.product-body p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.product-foot .primary-link {
  min-height: 38px;
  padding: 9px 13px;
}

.tag {
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 38px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.compact-heading {
  padding-top: 54px;
}

.faq-section {
  margin-bottom: 48px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.faq-grid details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.faq-grid summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-grid p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-shell {
  display: none;
  margin: 58px 0 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.admin-shell.active {
  display: block;
}

body.admin-route main > section:not(.admin-shell) {
  display: none;
}

body.admin-route .admin-shell {
  margin-top: 0;
  border-top: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
}

.admin-panel.seller-mode .admin-grid {
  grid-template-columns: 1fr;
}

.hidden {
  display: none !important;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.55fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 190px);
  padding: 48px 0;
}

.auth-card h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
}

.muted-copy,
.login-hint {
  color: var(--muted);
  line-height: 1.6;
}

.login-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.admin-session {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.admin-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  padding: 10px 13px;
}

.admin-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#currentUserBadge {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
  padding: 10px 12px;
}

.admin-form,
.admin-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.admin-form {
  display: grid;
  align-content: start;
  gap: 14px;
}

.admin-form h3,
.admin-list h3 {
  margin: 0 0 4px;
}

.admin-note {
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-form label,
.checkout-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toggle-field {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px !important;
}

.toggle-field input {
  width: 18px !important;
  height: 18px;
  accent-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-list {
  margin-top: 16px;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-list-head h3 {
  margin: 0;
}

.admin-list-head input {
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
}

.product-preview {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px);
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.order-row:first-of-type {
  border-top: 0;
}

.order-row h4,
.order-row p {
  margin: 0;
}

.order-row h4 {
  margin-bottom: 6px;
}

.order-row p,
.order-row a {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 4px;
}

.order-actions {
  display: grid;
  gap: 10px;
}

.order-actions select,
.reference-upload input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  color: var(--ink);
  padding: 10px;
}

.reference-upload {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 16px;
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-size: 30px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 900;
  margin-top: 4px;
}

.preview-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px;
}

.preview-card img {
  width: 86px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.preview-card h4,
.preview-card p {
  margin: 0;
}

.preview-card h4 {
  font-size: 15px;
}

.preview-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
}

.preview-card div div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

.preview-card strong {
  color: var(--accent-dark);
}

.muted-preview {
  opacity: 0.58;
}

.admin-product {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.admin-product:first-of-type {
  border-top: 0;
}

.admin-product img {
  width: 72px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.user-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 900;
}

.admin-product h4 {
  margin: 0 0 5px;
}

.admin-product p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-product-actions {
  display: flex;
  gap: 8px;
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.seller-form,
.category-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
}

.seller-form .form-actions,
.category-form .form-actions {
  grid-column: 1 / -1;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-content: end;
  background: rgba(23, 32, 51, 0);
  pointer-events: none;
  transition: background 180ms ease;
}

.cart-drawer.open {
  background: rgba(23, 32, 51, 0.42);
  pointer-events: auto;
}

.cart-panel {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  width: min(460px, 100vw);
  height: 100vh;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

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

.cart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.cart-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  min-height: 38px;
  padding: 8px 11px;
}

.cart-header h2 {
  margin: 0;
}

.cart-items {
  overflow-y: auto;
  padding: 8px 20px;
}

.cart-item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 13px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.cart-item img {
  width: 68px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-item h4 {
  margin: 0 0 4px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-controls button {
  width: 34px;
  height: 32px;
  border: 0;
  background: var(--soft);
  cursor: pointer;
  font-weight: 900;
}

.qty-controls span {
  min-width: 34px;
  text-align: center;
  font-weight: 800;
}

.remove-btn {
  border: 0;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.checkout-form {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.checkout-summary {
  display: grid;
  gap: 4px;
}

.checkout-summary h3,
.checkout-summary p {
  margin: 0;
}

.checkout-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cart-footer {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--line);
}

.cart-payments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;
}

.cart-payments span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cart-payments strong {
  border-radius: 999px;
  background: var(--soft);
  font-size: 12px;
  padding: 6px 9px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 18px;
}

.whatsapp-btn,
.telegram-btn {
  flex: 1 1 180px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  transition: filter 160ms ease, transform 160ms ease;
}

.whatsapp-btn:hover,
.telegram-btn:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.whatsapp-btn {
  background: #16a34a;
}

.telegram-btn {
  background: var(--blue);
}

.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 35;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, background 160ms ease;
}

.whatsapp-float:hover {
  background: #15803d;
  transform: translateY(-2px);
}

.whatsapp-float svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  opacity: 0;
  padding: 12px 14px;
  transform: translateY(10px);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 54px auto 0;
  padding: 28px 0 86px;
  border-top: 1px solid var(--line);
}

.site-footer h3,
.site-footer p {
  margin: 0;
}

.site-footer h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.site-footer p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding-top: 18px;
}

@media (max-width: 900px) {
  .hero,
  .toolbar,
  .admin-grid,
  .trust-strip,
  .how-pay,
  .how-panel,
  .faq-grid,
  .site-footer,
  .auth-card {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .brand small,
  .nav {
    display: none;
  }

  main {
    width: min(100% - 24px, 1180px);
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .section-heading,
  .admin-header,
  .admin-product {
    align-items: stretch;
    flex-direction: column;
  }

  .product-grid,
  .form-row,
  .seller-form,
  .category-form,
  .payment-chips {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 210px 1fr;
  }

  .admin-product {
    grid-template-columns: 64px 1fr;
  }

  .admin-product-actions {
    grid-column: 1 / -1;
  }

  .admin-list-head,
  .cart-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-list-head input {
    width: 100%;
  }

  .preview-card {
    grid-template-columns: 1fr;
  }

  .order-row,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .preview-card img {
    width: 100%;
    height: 150px;
  }
}
