: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(51, 33, 22, 0.11);
  --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;
}

.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);
  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 26px 40px rgba(124, 47, 36, 0.24);
}

.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 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;
}

#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 18px 36px rgba(58, 35, 24, 0.12);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#catalogProducts .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 44px rgba(58, 35, 24, 0.17);
}

#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: min(300px, calc((100vw - 220px) / 3));
  flex: 0 0 min(300px, calc((100vw - 220px) / 3));
}

#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;
}

.card img {
  width: 100%;
  height: 220px;
  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-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(32, 20, 12, 0.18);
  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;
}

.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 10px 18px rgba(162, 61, 46, 0.28);
}

.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 {
  width: 100%;
  height: 220px;
  object-fit: cover;
  cursor: zoom-in;
}

.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 {
  width: 100%;
  height: 210px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid var(--line);
}

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

.post-thumb-strip .thumb {
  cursor: zoom-in;
}

.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(52, 34, 22, 0.18);
  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(52, 34, 22, 0.24);
}

.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 {
  width: 100%;
  max-height: 56vh;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
}

.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;
}

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

.pay-frame-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pay-frame {
  width: 100%;
  min-height: 620px;
  border: 0;
}

.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;
}

.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 {
  width: 72px;
  height: 72px;
  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 {
  width: 100%;
  height: min(580px, 65vh);
  object-fit: cover;
  border-radius: 16px;
  cursor: zoom-in;
}

.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-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;
  }

  .pay-frame {
    min-height: 560px;
  }

  .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((100vw - 210px) / 2);
    flex: 0 0 calc((100vw - 210px) / 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) {
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .btn {
    width: 100%;
  }

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

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

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

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

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

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

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

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

  .pay-frame {
    min-height: 500px;
  }

  .carousel-wrap {
    padding: 0;
  }

  .carousel-track .card {
    min-width: calc(100vw - 120px);
    flex: 0 0 calc(100vw - 120px);
  }

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

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

  .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(46, 30, 20, 0.18);
    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;
  }
}
