:root {
  --bg: #f5f1ea;
  --bg-alt: #ede4d8;
  --panel: #fffdf8;
  --text: #2b241e;
  --muted: #6f6157;
  --line: #e8dbc9;
  --accent: #b74737;
  --accent-dark: #98382b;
  --ok: #247243;
  --danger: #97291f;
  --shadow: 0 16px 34px rgba(36, 32, 28, 0.1);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(1000px 560px at 100% -10%, #f9ead6, transparent 68%),
    radial-gradient(900px 440px at -15% 15%, #f0dccb, transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

body.custom-background {
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    var(--site-bg-image) center / cover fixed no-repeat;
}

.container {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

main.container {
  padding-bottom: 30px;
}

main.container > section {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(255, 251, 246, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  font-weight: 800;
}

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

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 12px;
}

.nav a:hover {
  background: #f6e9de;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e2d3c2;
  background: #fff8f0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.mobile-cart-link {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #e2d3c2;
  border-radius: 10px;
  background: #fff8f0;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.mobile-cart-link .cart-count {
  margin-left: 0;
}

.nav-toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #3f2f27;
  display: block;
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--accent);
  color: #fff;
  margin-left: 5px;
}

.cart-count-empty {
  opacity: 0.55;
}

.hero {
  padding: 42px 0 14px;
}

.hero-box {
  border-radius: 30px;
  padding: clamp(24px, 4vw, 44px);
  aspect-ratio: 24 / 5;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(133deg, #bc4b3a 0%, #a43c2f 44%, #7f2b22 100%);
  color: #fff;
  box-shadow: 0 20px 34px rgba(36, 32, 28, 0.13);
}

.hero-box.hero-with-banner {
  background:
    linear-gradient(120deg, var(--hero-banner-tint, rgba(127, 43, 34, 0.34)), var(--hero-banner-tint, rgba(127, 43, 34, 0.34))),
    var(--hero-banner-image) center / cover no-repeat,
    var(--hero-banner-bg-color, #7f2b22);
}

.hero-box.hero-transparent-bg {
  background:
    var(--hero-banner-image) center / cover no-repeat,
    transparent;
}

.hero-catalog-btn {
  min-height: 48px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: #fffdf8;
  color: #7f2b22;
  box-shadow: 0 10px 24px rgba(36, 32, 28, 0.14);
  font-weight: 800;
  text-decoration: none;
}

.hero-catalog-btn:hover {
  background: #fff5e8;
  color: #5f2019;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(36, 32, 28, 0.18);
}

.catalog-hero-box {
  position: relative;
  overflow: hidden;
  align-items: flex-end;
  padding-bottom: clamp(18px, 2.4vw, 30px);
  box-shadow: 0 16px 28px rgba(36, 32, 28, 0.1);
}

.catalog-hero-title {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.92);
  color: #6f2a22;
  box-shadow: 0 8px 18px rgba(36, 32, 28, 0.12);
  backdrop-filter: blur(6px);
  font-size: clamp(1.25rem, 2.8vw, 2rem);
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.06;
}

.hero p {
  max-width: 720px;
  margin-top: 14px;
  line-height: 1.5;
}

.section-title {
  margin: 14px 0 14px;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.carousel-controls {
  display: contents;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff8f0;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: #f6e9dd;
}

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

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-error {
  color: #9f2d24;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.field-wrap input[aria-invalid="true"] {
  border-color: #c83b31;
  box-shadow: 0 0 0 3px rgba(200, 59, 49, 0.12);
}

#catalogProducts.grid {
  grid-template-columns: repeat(3, minmax(230px, 320px));
  justify-content: center;
  gap: 22px;
}

#catalogProducts .card {
  border-radius: 22px;
  border: 1px solid #eadccc;
  box-shadow: 0 16px 32px rgba(36, 32, 28, 0.1);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#catalogProducts .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 38px rgba(36, 32, 28, 0.14);
}

#catalogProducts .card img {
  height: 250px;
}

#catalogProducts .card-body {
  padding: 16px 16px 14px;
}

#catalogProducts .card h3 {
  font-size: 1.1rem;
  line-height: 1.3;
}

#catalogProducts .price-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #efe2d5;
}

.carousel-wrap {
  overflow: hidden;
  position: relative;
  padding: 0;
}

.carousel-track {
  display: flex;
  gap: 16px;
  transition: transform 0.35s ease;
  will-change: transform;
  padding: 0 2px;
}

.carousel-track .card {
  min-width: calc((100% - 48px) / 4);
  flex: 0 0 calc((100% - 48px) / 4);
}

#featuredPrev,
#featuredNext {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

#featuredPrev {
  left: 6px;
}

#featuredNext {
  right: 6px;
}

#featuredPrev:disabled,
#featuredNext:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-media-link {
  display: block;
  aspect-ratio: 4 / 3;
  background: #f7efe6;
  overflow: hidden;
}

.card img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.muted {
  color: var(--muted);
}

.pvz-combobox {
  position: relative;
}

.pvz-loading {
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.pvz-loading::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 8px;
  border: 2px solid rgba(139, 45, 36, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -0.1em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pvz-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(36, 32, 28, 0.14);
  z-index: 30;
  padding: 6px;
}

.pvz-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.pvz-option:hover,
.pvz-option.active {
  background: #f5ebdf;
}

.pvz-option-title {
  font-weight: 600;
  color: var(--text);
}

.pvz-option-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.pvz-map {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f3ece2;
}

.price-row {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.in-stock {
  color: var(--ok);
  font-size: 0.9rem;
}

.out-stock {
  color: var(--danger);
  font-size: 0.9rem;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.card-qty-input {
  width: 88px;
  padding: 10px 42px 10px 8px;
  border-radius: 10px;
  border: 1px solid #d8c6b7;
  font: inherit;
}

.qty-with-unit {
  position: relative;
  display: inline-block;
}

.qty-unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.cart-mobile-list {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  text-decoration: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 14px;
  margin-top: 4px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 9px 18px rgba(36, 32, 28, 0.16);
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-danger {
  background: #f1d2cd;
  color: #7c1e16;
}

.btn-ghost {
  background: #f5eae0;
  color: #3f2f27;
}

.posts {
  display: grid;
  gap: 12px;
  padding-bottom: 36px;
}

.home-banners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.banner-post {
  display: grid;
  grid-template-columns: minmax(170px, 260px) 1fr;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.banner-post-image {
  display: block;
  width: 100%;
  height: 220px;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  cursor: zoom-in;
  background: #f7efe6;
}

.banner-post .post-media {
  align-self: start;
}

.post-video-autoplay {
  cursor: pointer;
}

.banner-post-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banner-post-body h4 {
  margin: 0;
  font-size: 1.16rem;
}

.banner-post-body p {
  margin: 0;
  color: var(--muted);
}

.banner-post-body .card-actions {
  margin-top: auto;
}

.banner-post-body .card-actions .btn {
  width: auto;
}

.post {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  padding: 12px;
}

.post h4 {
  margin: 0 0 8px;
}

.post-media {
  display: grid;
  gap: 8px;
}

.post-cover {
  display: block;
  width: 100%;
  height: 210px;
  aspect-ratio: 24 / 17;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid var(--line);
  background: #f7efe6;
}

.post-thumb-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-thumb-strip .thumb {
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}

.post-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-body p {
  margin: 0;
}

.post-body .btn {
  align-self: flex-start;
  width: auto;
}

.about-panel {
  margin-bottom: 22px;
}

.about-panel h4 {
  margin: 14px 0 8px;
}

.social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #e2d3c2;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 8px 14px rgba(36, 32, 28, 0.13);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.social-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 18px rgba(36, 32, 28, 0.16);
}

.social-tg {
  background: linear-gradient(180deg, #36b7ff 0%, #1b95e0 100%);
}

.social-vk {
  background: linear-gradient(180deg, #3a95ff 0%, #1f6fdd 100%);
}

.social-max {
  background: #fff;
  border-color: #dfe3ea;
}

.social-max img {
  width: 18px;
  height: 18px;
  display: block;
}

.social-link svg {
  display: block;
}

.post-read-panel {
  width: min(900px, 96vw);
  max-height: 90vh;
  overflow: auto;
}

.post-read-close {
  margin-left: auto;
}

.post-read-media {
  display: block;
  width: 100%;
  max-height: 56vh;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7efe6;
}

.post-read-text {
  font-size: 1.03rem;
  line-height: 1.55;
}

.footer {
  padding: 14px 0 30px;
  color: var(--muted);
}

.footer-legal-links {
  margin-top: 8px;
  font-size: 0.92rem;
}

.admin-layout,
.cart-page,
.product-page,
.track-page {
  padding: 22px 0 38px;
  display: grid;
  gap: 18px;
}

.product-page {
  min-height: calc(100vh - 170px);
}

.track-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.speedpay-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.speedpay-container {
  display: grid;
  gap: 12px;
  min-height: 72px;
}

.speedpay-container:empty::before {
  content: "Загружаем способы оплаты...";
  color: var(--muted);
}

.payment-choice-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.payment-choice-actions .btn {
  width: 100%;
  justify-content: center;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #f8efe5;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #d33b2f;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.diagnostics-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf3;
}

.diagnostics-card strong {
  font-size: 1.05rem;
}

.diagnostics-log {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.diagnostics-log-entry {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
}

.diagnostics-log-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.diagnostics-log pre {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.84rem/1.45 Consolas, "Courier New", monospace;
  color: #3d3029;
  background: #f7eee4;
  border-radius: 10px;
  padding: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 16px;
}

.filters-panel {
  margin-bottom: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(253, 247, 239, 0.92));
  border: 1px solid #eadccc;
  overflow: hidden;
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease, margin 0.25s ease, padding 0.25s ease;
}

.filters-topbar {
  margin-bottom: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filters-collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

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

.catalog-sidebar {
  position: sticky;
  top: 86px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 245, 236, 0.96));
  border: 1px solid #eadccc;
}

.catalog-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.sidebar-title {
  margin: 2px 0 12px;
  font-size: 1.05rem;
}

.sidebar-block {
  margin-bottom: 12px;
}

.sidebar-label {
  font-weight: 800;
  margin-bottom: 6px;
}

.section-list {
  display: block;
}

.section-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #efe4d7;
  background: rgba(255, 255, 255, 0.66);
}

.section-link:hover {
  background: #f8efe5;
  border-color: #e8d0be;
}

.section-link.active {
  background: #f7e0db;
  border-color: #e9bdb5;
  color: #8f2b21;
}

.section-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.notice {
  margin-top: 12px;
  background: #fff2d9;
  border: 1px solid #f4ddb2;
  color: #7a4f20;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-search {
  min-width: 0;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-wide {
  grid-column: span 4;
}

.filter-field:not(.filter-wide) {
  grid-column: span 2;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.filter-actions {
  grid-column: span 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.filters-grid input,
.filters-grid select {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid #d8c6b7;
  background: #fff;
  font: inherit;
}

#filterSummary {
  margin-top: 10px;
  font-weight: 600;
}

.catalog-empty {
  background: var(--panel);
  border: 1px dashed #ddcbb9;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pager.hidden {
  display: none;
}

.pager-info {
  color: var(--muted);
  font-weight: 700;
  margin: 0 6px;
}

.pager-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #e2d3c2;
  background: #fff8f0;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  padding: 0 10px;
}

.pager-btn:hover {
  background: #f7ebde;
}

.pager-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  will-change: opacity, transform;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none;
}

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

.form-grid textarea,
.form-grid input,
.form-grid select {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid #d8c6b7;
  background: #fff;
  font: inherit;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.form-grid .checkbox-inline {
  align-self: center;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

.form-grid input[type="checkbox"],
td input[type="checkbox"],
.panel input[type="checkbox"] {
  width: auto;
  height: 16px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.orders-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) auto auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.orders-filter-bar .btn {
  margin-top: 0;
  width: auto;
}

.orders-filter-bar input[type="text"],
.orders-filter-bar input[type="search"],
.orders-filter-bar input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid #d8c6b7;
  background: #fff;
  font: inherit;
}

.form-grid textarea {
  min-height: 86px;
  grid-column: 1 / -1;
  resize: vertical;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.status {
  margin-top: 8px;
  min-height: 19px;
  color: #7a261f;
}

.bulk-actions {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

.table-scroll > table {
  min-width: 760px;
  margin-top: 0;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: top;
  font-size: 0.93rem;
}

td input,
td textarea,
td select {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid #d9cabc;
  font: inherit;
}

.table-link {
  color: #843026;
  text-decoration: none;
  font-weight: 700;
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.thumb {
  display: block;
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.thumb-wrap,
.mini-thumb-wrap {
  position: relative;
  display: inline-flex;
}

.sortable-thumb {
  cursor: grab;
}

.sortable-thumb:active {
  cursor: grabbing;
}

.thumb-remove-btn,
.mini-thumb-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: #a83a2d;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.thumb-switch {
  cursor: pointer;
}

.mini-thumbs {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mini-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.color-input-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: center;
}

.color-input-row input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 0;
  border: 1px solid #d8c6b7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.post-preview-panel {
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow: auto;
}

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

.post-preview-head h3 {
  margin: 0;
}

.post-video-preview-wrap {
  position: relative;
  width: fit-content;
  margin-top: 6px;
}

.post-video-preview {
  width: 260px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #000;
}

.mini-post-video {
  width: 180px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #000;
  margin-top: 6px;
}

.mini-post-video-wrap {
  position: relative;
  width: fit-content;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 22px;
}

.product-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.product-switchers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-switch-btn {
  min-width: 146px;
}

.product-image {
  display: block;
  width: 100%;
  height: min(580px, 65vh);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  cursor: zoom-in;
  background: #f7efe6;
}

.product-meta {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.product-price {
  font-size: 1.55rem;
  font-weight: 800;
}

.product-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-qty {
  width: 92px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12, 10, 8, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-image {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-video {
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  background: #000;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(18, 18, 18, 0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.52);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(18, 18, 18, 0.72);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox.hidden {
  display: none;
}

.success-panel {
  margin-top: 32px;
  text-align: center;
  padding: 34px 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.status-new {
  color: #875723;
  background: #fff2d9;
  border-color: #f4ddb2;
}

.status-paid,
.status-done {
  color: #1f6a3f;
  background: #daf4e5;
  border-color: #bde7cf;
}

.status-packed {
  color: #30498e;
  background: #e1e9ff;
  border-color: #c3d2ff;
}

.status-shipped {
  color: #0f6161;
  background: #d8f4f4;
  border-color: #b6e7e7;
}

.status-cancelled {
  color: #85261f;
  background: #f8ddd9;
  border-color: #f0c2bc;
}

.status-archived {
  color: #575757;
  background: #ececec;
  border-color: #d9d9d9;
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-direction: row;
    align-items: center;
  }

  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-nav-bar {
    align-items: flex-start;
  }

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

  .filter-wide {
    grid-column: span 6;
  }

  .filter-field:not(.filter-wide) {
    grid-column: span 2;
  }

  .filter-actions {
    grid-column: span 6;
  }

  .filters-topbar {
    align-items: flex-start;
  }

  .orders-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  #catalogProducts.grid {
    grid-template-columns: repeat(2, minmax(220px, 320px));
    justify-content: center;
  }

  .catalog-sidebar {
    position: static;
  }

  .carousel-track .card {
    min-width: calc((100% - 16px) / 2);
    flex: 0 0 calc((100% - 16px) / 2);
  }

  .home-banners {
    grid-template-columns: 1fr;
  }

  .banner-post {
    grid-template-columns: 1fr;
  }

  .banner-post-image {
    height: 220px;
    max-height: 300px;
  }

  .post {
    grid-template-columns: 1fr;
  }

  .post-cover {
    height: 220px;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .container {
    width: min(100% - 28px, 1160px);
  }

  .panel {
    padding: 14px;
    max-width: 100%;
    overflow: hidden;
  }

  .cart-page {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .form-grid > *,
  .field-wrap,
  .pvz-combobox,
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-width: 0;
    max-width: 100%;
  }

  .form-grid .full {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .cart-page h2 {
    font-size: clamp(1.55rem, 9vw, 2.1rem);
    line-height: 1.12;
  }

  .cart-page .muted {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  th,
  td {
    font-size: 0.84rem;
  }

  .cart-page .cart-desktop-table {
    display: none;
  }

  .cart-page .cart-mobile-list {
    display: grid;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
  }

  .cart-page .cart-mobile-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffdfa;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .cart-page .cart-mobile-title {
    color: #8a2f27;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .cart-page .cart-mobile-meta {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .cart-page .cart-mobile-meta > div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 0;
  }

  .cart-page .cart-mobile-meta dt {
    color: var(--muted);
    font-weight: 800;
  }

  .cart-page .cart-mobile-meta dd {
    margin: 0;
    min-width: 0;
  }

  .cart-page .cart-mobile-card .qty-with-unit {
    max-width: 150px;
  }

  .cart-page .cart-mobile-remove {
    justify-self: start;
    width: auto;
    min-width: 124px;
    padding: 9px 16px;
    border-radius: 12px;
    box-shadow: none;
  }

  .cart-page .cart-mobile-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px 0;
    border-top: 1px solid var(--line);
    font-weight: 800;
  }

  .btn {
    width: 100%;
  }

  .cart-page .cart-mobile-card .cart-mobile-remove {
    width: auto;
    max-width: 100%;
  }

  .hero {
    padding: 24px 0 12px;
  }

  .hero-box {
    min-height: 160px;
    aspect-ratio: 16 / 9;
    padding: 16px;
    border-radius: 22px;
    align-items: flex-end;
    background-position: center;
  }

  .hero-box.hero-with-banner,
  .hero-box.hero-transparent-bg {
    background-size: cover;
    background-position: center;
  }

  .hero-catalog-btn,
  .hero-box .hero-catalog-btn {
    width: auto;
    max-width: min(100%, 220px);
    min-height: 40px;
    padding: 9px 16px;
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  .hero-box h2 {
    max-width: 100%;
    margin: 0;
    font-size: clamp(1.35rem, 7vw, 2rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .catalog-hero-title {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: clamp(1.05rem, 5.4vw, 1.4rem);
  }

  .hero-box:not(.hero-with-banner):not(.hero-transparent-bg) {
    justify-content: flex-start;
  }

  .post-body .btn,
  .banner-post-body .card-actions .btn {
    width: auto;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filters-panel.filters-collapsed {
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
  }

  .filters-panel:not(.filters-collapsed) {
    max-height: none;
  }

  .filter-wide,
  .filter-field:not(.filter-wide),
  .filter-actions {
    grid-column: span 1;
  }

  .filter-search {
    min-width: 0;
  }

  .filters-grid input,
  .filters-grid select {
    min-height: 48px;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 16px;
    line-height: 1.25;
  }

  .filters-topbar .btn {
    width: auto;
  }

  .orders-filter-bar {
    grid-template-columns: 1fr;
  }

  .orders-filter-bar .btn {
    width: auto;
  }

  .table-scroll > table {
    min-width: 620px;
  }

  .carousel-wrap {
    padding: 0;
  }

  .carousel-track .card {
    min-width: 100%;
    flex: 0 0 100%;
  }

  #catalogProducts.grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #catalogProducts .card {
    border-radius: 18px;
  }

  #catalogProducts .card-media-link {
    aspect-ratio: 4 / 3;
    background: #f7efe6;
  }

  #catalogProducts .card img {
    height: 100%;
    object-fit: cover;
    padding: 0;
    background: #f7efe6;
  }

  #catalogProducts .card-body {
    padding: 14px 16px 16px;
    gap: 9px;
  }

  #catalogProducts .card h3 {
    font-size: 1.08rem;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .mobile-cart-link {
    display: inline-flex;
    margin-left: auto;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    background: rgba(255, 251, 246, 0.98);
    border: 1px solid #eadccc;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 18px 34px rgba(36, 32, 28, 0.14);
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .topbar.nav-open .nav {
    display: grid;
  }

  .nav a {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 10px 12px;
  }

  .brand {
    font-size: clamp(1.05rem, 4.5vw, 1.35rem);
  }
}

body.mobile-nav-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
