:root {
  --ink: #171a1f;
  --muted: #687078;
  --line: #dfe3e6;
  --soft: #f4f6f5;
  --paper: #ffffff;
  --accent: #087a55;
  --accent-dark: #056343;
  --accent-soft: #e4f3ed;
  --gold: #a96f06;
  --gold-soft: #fff4d9;
  --danger: #b43f38;
  --danger-soft: #fbecea;
  --blue: #2563a6;
  --shadow: 0 16px 45px rgba(23, 26, 31, 0.14);
  --header-height: 80px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select, input[type="checkbox"], input[type="range"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(8, 122, 85, .22); outline-offset: 2px; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
[hidden] { display: none !important; }

.site-header {
  height: var(--header-height);
  padding: 0 clamp(18px, 4vw, 58px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; color: var(--ink); text-decoration: none; }
.brand-mark { background: var(--ink); color: #fff; padding: 5px 7px; font-size: 13px; line-height: 1; font-weight: 800; }
.brand-mark.has-logo { width: 116px; height: 62px; padding: 0; background: transparent; }
.brand-mark.has-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 17px; }
.main-nav { display: flex; height: 100%; gap: 6px; }
.nav-button { border: 0; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 0 16px; position: relative; }
.nav-button::after { content: ""; height: 2px; background: var(--accent); position: absolute; left: 16px; right: 16px; bottom: -1px; transform: scaleX(0); transition: transform .2s ease; }
.nav-button:hover, .nav-button.is-active { color: var(--ink); }
.nav-button.is-active::after { transform: scaleX(1); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.header-select { position: relative; height: 38px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); display: inline-flex; align-items: center; gap: 5px; padding: 0 5px 0 9px; color: var(--muted); }
.header-select::after { content: ""; position: absolute; right: 8px; top: 13px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.header-select svg { width: 16px; height: 16px; }
.header-select select { appearance: none; -webkit-appearance: none; height: 34px; min-width: 0; border: 0; outline: 0; padding: 0 22px 0 3px; background-color: transparent; color: var(--ink); font-size: 12px; }
.language-select select { width: 42px; }
.currency-select select { width: 58px; }
.agent-select select { width: 115px; }
.invite-select select { width: 142px; }
.header-select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,122,85,.1); }
.saved-button, .icon-button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.saved-button { height: 38px; border-radius: 6px; padding: 0 11px; gap: 8px; }
.saved-button strong { min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--ink); font-size: 11px; }
.icon-button { width: 38px; height: 38px; border-radius: 6px; padding: 0; }
.icon-button:hover, .saved-button:hover { background: var(--soft); }
.mobile-filter-button { display: none; }

main { min-height: calc(100vh - var(--header-height)); }
.view { display: none; }
.view.is-active { display: block; }
.catalog-heading, .admin-header {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(30px, 3vw, 44px); line-height: 1.08; }
h2 { font-size: 20px; margin: 0; line-height: 1.25; }
h3 { margin: 0; }
.heading-copy { color: var(--muted); margin: 10px 0 0; max-width: 640px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.social-button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-size: 12px; font-weight: 750; }
.social-button:hover { border-color: var(--ink); background: var(--soft); }
.social-button.whatsapp:hover { color: #077a55; border-color: #077a55; }
.social-button.telegram:hover { color: #1677ba; border-color: #1677ba; }
.social-button.discord:hover { color: #5865f2; border-color: #5865f2; }
.social-mark { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 8px; line-height: 1; font-weight: 900; letter-spacing: 0; }
.social-button.whatsapp .social-mark { background: #16a36b; }
.social-button.telegram .social-mark { background: #168dcc; }
.social-button.discord .social-mark { background: #5865f2; }
.search-shell { width: min(540px, 44vw); height: 50px; border: 1px solid #b9c1c4; border-radius: 6px; display: flex; align-items: center; gap: 11px; padding: 0 14px; background: #fff; }
.search-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,122,85,.1); }
.search-shell input { border: 0; outline: 0; min-width: 0; flex: 1; color: var(--ink); }
.search-shell kbd { color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 12px; }

.category-strip { display: none; width: min(1480px, calc(100% - 48px)); margin: 0 auto 24px; }
.category-strip::-webkit-scrollbar { display: none; }
.desktop-category-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.desktop-category-strip::-webkit-scrollbar { display: none; }
.mobile-quick-filters { display: none; }
.category-chip { flex: 0 0 auto; height: 34px; border: 1px solid var(--line); border-radius: 17px; padding: 0 14px; color: var(--muted); background: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.category-chip:hover, .category-chip.is-active { color: #fff; border-color: var(--ink); background: var(--ink); }
.mobile-filter-chip { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.category-filter-link, .category-all-option { text-decoration: none; }
.category-filter-link:hover, .category-filter-link.is-active, .category-all-option:hover, .category-all-option.is-active { color: var(--accent-dark); }
.category-filter-link.is-active, .category-all-option.is-active { font-weight: 750; }
.category-filter-marker { width: 7px; height: 7px; flex: 0 0 7px; border: 1px solid #aab3b7; border-radius: 50%; }
.category-filter-link.is-active .category-filter-marker, .category-all-option.is-active .category-filter-marker { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.catalog-layout { border-top: 1px solid var(--line); display: grid; grid-template-columns: 260px minmax(0, 1fr); width: min(1480px, calc(100% - 48px)); margin: 0 auto; }
.filter-panel { padding: 22px 28px 50px 0; border-right: 1px solid var(--line); }
.filter-mobile-head { display: none; }
.filter-section { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.filter-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 750; }
.filter-title button { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: 12px; }
.filter-title button:hover { color: var(--accent); }
.brand-filter-title { align-items: center; }
.brand-filter-actions { display: inline-flex; align-items: center; gap: 8px; }
.filter-collapse-button { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); padding: 0; }
.collapse-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(225deg) translate(-1px, -1px); transition: transform .18s ease; }
.filter-collapse-button[aria-expanded="false"] .collapse-chevron { transform: rotate(45deg) translate(-1px, -1px); }
.brand-search-field { display: block; margin: 0 0 12px; }
.brand-search-field input, .mobile-brand-search input { width: 100%; height: 34px; padding: 0 10px; font-size: 12px; }
.mobile-brand-search { display: none; }
.filter-value { color: var(--muted); font-size: 12px; font-weight: 500; }
.filter-options { display: grid; gap: 9px; }
.filter-option { display: flex; align-items: center; gap: 9px; color: #444b50; }
.filter-option input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.filter-option .filter-count { margin-left: auto; color: #969da1; font-size: 12px; }
.brand-more-button { margin-top: 10px; border: 0; background: transparent; color: var(--accent); padding: 0; font-size: 12px; font-weight: 750; cursor: pointer; }
.brand-more-button:hover { color: var(--accent-dark); text-decoration: underline; }
.category-tree { display: grid; gap: 2px; }
.category-tree-node { min-width: 0; }
.category-tree-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; min-height: 34px; }
.category-tree-row > .filter-option { min-width: 0; }
.category-toggle, .category-toggle-spacer { width: 18px; height: 28px; display: inline-grid; place-items: center; color: #8c969d; }
.category-toggle { padding: 0; border: 0; background: transparent; cursor: pointer; }
.category-toggle:hover { color: var(--ink); }
.category-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); }
.category-tree-node.is-collapsed > .category-tree-row .category-chevron { transform: rotate(-45deg) translate(-1px, 1px); }
.category-children { margin-left: 18px; padding-left: 10px; border-left: 1px solid #e3e7e8; display: grid; gap: 2px; }
.category-tree-node.is-collapsed > .category-children { display: none; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 9px; font-weight: 800; }
.range-input { width: 100%; accent-color: var(--accent); }
.toggle-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { color: var(--muted); margin-top: 2px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-ui { width: 42px; height: 24px; border-radius: 12px; background: #bdc4c7; position: relative; transition: .2s; }
.toggle-ui::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-row input:checked + .toggle-ui { background: var(--accent); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(18px); }
.settings-row input:checked + .toggle-ui { background: var(--accent); }
.settings-row input:checked + .toggle-ui::after { transform: translateX(18px); }

.catalog-results { min-width: 0; width: 100%; overflow: hidden; padding: 22px 0 64px 28px; }
.results-toolbar { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.results-toolbar p { margin: 0; color: var(--muted); }
.results-toolbar strong { color: var(--ink); }
.select-label { color: var(--muted); display: flex; align-items: center; gap: 8px; }
select, input, textarea { border: 1px solid #cbd1d4; border-radius: 5px; background: #fff; color: var(--ink); }
select { height: 36px; padding: 0 30px 0 10px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 7px; min-height: 0; }
.active-filters:not(:empty) { margin: 10px 0 4px; }
.filter-tag { border: 1px solid #b9d9cc; background: var(--accent-soft); color: var(--accent-dark); border-radius: 15px; height: 29px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; }
.filter-tag svg { width: 14px; height: 14px; }
.ad-carousel { width: min(1480px, calc(100% - 48px)); margin: 0 auto 30px; }
.ad-carousel[hidden] { display: none; }
.ad-carousel-viewport { position: relative; width: 100%; aspect-ratio: 1480 / 360; min-height: 180px; overflow: hidden; border-radius: 8px; background: #eef2f1; }
.ad-carousel-track { display: flex; width: 100%; height: 100%; transition: transform .35s ease; touch-action: pan-y; }
.ad-carousel-slide { flex: 0 0 100%; min-width: 0; height: 100%; }
.ad-carousel-slide img, .ad-carousel-slide a, .ad-carousel-slide picture { display: block; width: 100%; height: 100%; }
.ad-carousel-slide img { object-fit: cover; }
.ad-carousel-arrow { position: absolute; top: 50%; z-index: 2; width: 38px; height: 38px; transform: translateY(-50%); border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ad-carousel-arrow:hover, .ad-carousel-arrow:focus-visible { background: #fff; }
.ad-carousel-arrow svg { width: 20px; height: 20px; }
.ad-carousel-prev { left: 14px; }
.ad-carousel-next { right: 14px; }
.ad-carousel-dots { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.ad-carousel-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #c3cdca; cursor: pointer; }
.ad-carousel-dot.is-active { background: var(--accent-dark); transform: scale(1.25); }
.ad-carousel-arrow[hidden], .ad-carousel-dots[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ad-carousel-track { transition: none; } }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.catalog-pagination { min-height: 42px; margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.catalog-pagination[hidden] { display: none; }
.pagination-page, .pagination-nav { height: 36px; border: 1px solid #cbd1d4; border-radius: 5px; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.pagination-page { width: 36px; padding: 0; }
.pagination-nav { min-width: 104px; padding: 0 12px; }
.pagination-page:hover, .pagination-nav:hover { border-color: var(--accent); color: var(--accent-dark); }
.pagination-page.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.pagination-page:disabled, .pagination-nav:disabled { cursor: default; opacity: .42; }
.pagination-ellipsis { width: 26px; text-align: center; color: var(--muted); }
.product-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #c5cbce; box-shadow: 0 10px 26px rgba(23,26,31,.09); }
.product-image-wrap { position: relative; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.product-image-button { width: 100%; height: 100%; padding: 0; border: 0; background: #fff; display: block; cursor: pointer; }
.product-image { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .25s ease; }
.product-card:hover .product-image { transform: scale(1.025); }
.save-product { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.94); border: 0; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; box-shadow: 0 2px 9px rgba(0,0,0,.1); }
.save-product.is-saved { color: var(--accent); }
.save-product.is-saved svg { fill: currentColor; }
.save-glyph { font-size: 21px; line-height: 1; }
.stock-badge { position: absolute; left: 10px; bottom: 10px; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 800; background: rgba(255,255,255,.94); }
.stock-badge.low { color: var(--danger); }
.product-body { padding: 13px; }
.product-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 750; }
.product-title { min-width: 0; border: 0; background: transparent; padding: 0; text-align: left; margin: 7px 0 12px; line-height: 1.4; font-weight: 680; color: var(--ink); width: 100%; height: 42px; overflow: hidden; overflow-wrap: anywhere; }
.product-title:hover { color: var(--accent); }
.product-stats { min-height: 20px; margin: -4px 0 8px; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 5px; }
.product-stats svg { width: 14px; height: 14px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { min-width: 0; font-size: 18px; font-weight: 800; white-space: nowrap; }
.price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.buy-button { position: relative; width: 66px; height: 36px; padding: 0 9px; border: 1px solid var(--ink); border-radius: 5px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 800; }
.product-card .buy-button { display: none !important; }
.buy-button:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.buy-arrow { position: relative; width: 14px; height: 14px; }
.buy-arrow { width: 18px; height: 18px; }
.buy-arrow::before { content: ""; position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-top: 2.5px solid currentColor; border-right: 2.5px solid currentColor; }
.buy-arrow::after { content: ""; position: absolute; left: 1px; bottom: 4px; width: 16px; height: 2.5px; background: currentColor; transform: rotate(-45deg); transform-origin: center; }
.empty-state { padding: 90px 20px; text-align: center; color: var(--muted); }
.empty-state > svg { width: 42px; height: 42px; }
.empty-state h2 { color: var(--ink); margin-top: 14px; }
.empty-state p { margin: 7px 0 18px; }

.admin-view { background: #f7f8f7; min-height: calc(100vh - var(--header-height)); padding-bottom: 70px; }
.admin-header { align-items: center; padding-bottom: 22px; }
.status-pill { border: 1px solid var(--line); background: #fff; height: 34px; padding: 0 12px; border-radius: 17px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.status-pill span { width: 8px; height: 8px; background: #25a66e; border-radius: 50%; box-shadow: 0 0 0 3px #dff2e9; }
.stats-row { width: min(1480px, calc(100% - 48px)); margin: 0 auto 24px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat-item { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.stat-icon { width: 38px; height: 38px; border-radius: 6px; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.stat-item strong, .stat-item small { display: block; }
.stat-item strong { font-size: 23px; line-height: 1.1; }
.stat-item small { color: var(--muted); margin-top: 4px; }
.admin-tabs { width: min(1480px, calc(100% - 48px)); margin: 0 auto; border-bottom: 1px solid var(--line); display: flex; gap: 4px; overflow-x: auto; }
.admin-tab { flex: 0 0 auto; height: 45px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; display: flex; align-items: center; gap: 7px; color: var(--muted); }
.admin-tab:hover, .admin-tab.is-active { color: var(--ink); }
.admin-tab.is-active { border-bottom-color: var(--accent); }
.admin-panel { display: none; width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding-top: 24px; }
.admin-panel.is-active { display: block; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; }
.panel-heading.compact { margin-top: 27px; }
.panel-heading p { color: var(--muted); margin: 4px 0 0; }
.limit-label { color: var(--muted); font-size: 12px; }
.import-tool { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 22px; }
.field-label { font-weight: 700; display: block; margin-bottom: 8px; }
textarea { width: 100%; resize: vertical; padding: 12px; line-height: 1.5; }
.import-settings { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(210px, 1fr) auto auto; gap: 18px; align-items: end; padding: 18px 0; }
.import-settings > label:not(.checkbox-setting) { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.checkbox-setting { min-height: 36px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.checkbox-setting input { accent-color: var(--accent); width: 16px; height: 16px; }
.import-actions { display: flex; gap: 10px; align-items: center; }
.primary-button, .secondary-button, .text-button { min-height: 38px; border-radius: 5px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary-button { color: var(--ink); background: #fff; border: 1px solid #bdc4c7; }
.secondary-button:hover { background: var(--soft); }
.text-button { color: var(--accent); background: transparent; border: 0; }
.text-button:hover { background: var(--accent-soft); }
.progress-wrap { margin-top: 20px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.progress-copy strong { color: var(--ink); }
.progress-track { height: 7px; overflow: hidden; border-radius: 4px; background: #e7eae8; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s ease; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); background: #fafbfa; font-size: 11px; font-weight: 750; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table select { max-width: 160px; }
.check-col { width: 44px; }
.table-product { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.table-product img { width: 46px; height: 46px; border-radius: 5px; object-fit: cover; background: var(--soft); }
.table-product strong, .table-product small { display: block; }
.table-product strong { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-product small { color: var(--muted); margin-top: 2px; }
.table-title-line { display: flex; align-items: center; gap: 5px; min-width: 0; }
.table-title-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.quick-edit-button { width: 26px; height: 26px; flex: 0 0 auto; border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.quick-edit-button:hover { color: var(--accent); background: var(--accent-soft); }
.quick-edit-button svg { width: 14px; height: 14px; }
.status-label { display: inline-flex; align-items: center; height: 24px; border-radius: 12px; padding: 0 9px; font-size: 11px; font-weight: 700; }
.status-label.published { color: var(--accent-dark); background: var(--accent-soft); }
.status-label.draft { color: var(--gold); background: var(--gold-soft); }
.status-label.failed { color: var(--danger); background: var(--danger-soft); }
.source-badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 12px; padding: 0 9px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 750; }
.source-badge.weidian { color: var(--accent-dark); background: var(--accent-soft); }
.source-badge.taobao { color: #c35113; background: #fff0e8; }
.source-badge.\31 688 { color: var(--blue); background: #e8f1fb; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions .icon-button { width: 32px; height: 32px; border-color: transparent; }
.inline-number-control { display: flex; align-items: center; gap: 5px; min-width: 125px; }
.inline-number-control input { width: 82px; height: 32px; padding: 0 7px; }
.inline-number-control .icon-button { width: 32px; height: 32px; }
.inline-create { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 14px; margin-bottom: 14px; display: flex; gap: 9px; }
.inline-create input { min-width: 180px; padding: 0 10px; }
.management-list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.management-row { min-height: 66px; padding: 10px 15px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.5fr 1fr 120px 110px; gap: 16px; align-items: center; }
.management-row:last-child { border-bottom: 0; }
.management-primary { display: flex; align-items: center; gap: 11px; min-width: 0; }
.management-primary strong, .management-primary small { display: block; }
.management-primary small { color: var(--muted); margin-top: 2px; }
.management-icon, .brand-monogram { width: 38px; height: 38px; border-radius: 6px; background: var(--soft); display: grid; place-items: center; flex: 0 0 auto; font-weight: 800; }
.management-meta { color: var(--muted); }
.management-count { font-weight: 750; }
.management-actions { justify-self: end; display: flex; gap: 3px; }
.platform-management .management-row { grid-template-columns: 1.1fr minmax(220px, 2fr) 110px 90px; }
.platform-logo { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 5px; object-fit: contain; background: #fff; }
.template-code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--muted); }
.settings-form { max-width: 760px; border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.settings-section + .settings-section { border-top: 8px solid #f7f8f7; }
.settings-section h3 { margin: 0; padding: 15px 18px 9px; font-size: 13px; color: var(--accent-dark); }
.settings-row, .settings-field { min-height: 78px; padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; position: relative; }
.settings-row strong, .settings-row small, .settings-field strong, .settings-field small { display: block; }
.settings-row small, .settings-field small { color: var(--muted); margin-top: 3px; }
.settings-row input { position: absolute; opacity: 0; }
.settings-field input { width: 150px; height: 40px; padding: 0 10px; }
.settings-section:first-child .settings-field input { width: min(360px, 44vw); }
.settings-logo-field { align-items: start; }
.logo-upload-control { display: flex; align-items: center; gap: 12px; }
.site-logo-preview { width: 104px; height: 52px; border: 1px dashed #b9c1c3; border-radius: 6px; background: var(--ink); color: #fff; display: grid; place-items: center; overflow: hidden; font-size: 15px; font-weight: 800; }
.site-logo-preview img { width: 100%; height: 100%; display: block; object-fit: contain; background: #fff; }
.logo-upload-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-upload-actions input[type="file"] { width: min(230px, 32vw); height: auto; padding: 0; }
.settings-textarea { grid-template-columns: 1fr; align-items: start; }
.settings-textarea textarea { min-height: 76px; padding: 10px; }
.settings-form > .primary-button { margin: 16px 18px; }

dialog { border: 0; padding: 0; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(23,26,31,.58); }
.dialog-close { position: absolute; top: 13px; right: 13px; z-index: 2; }
.product-dialog { width: min(980px, calc(100% - 28px)); max-height: calc(100vh - 28px); border-radius: 8px; overflow: hidden; }
.product-detail { display: grid; grid-template-columns: 1.06fr .94fr; max-height: calc(100vh - 28px); }
.detail-gallery-shell { min-width: 0; align-self: start; background: #fff; }
.detail-gallery { width: 100%; height: auto; min-height: 0; aspect-ratio: 1 / 1; align-self: start; background: #fff; display: grid; place-items: center; overflow: hidden; }
.detail-gallery img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: contain; }
.detail-thumbnails { display: grid; grid-auto-flow: column; grid-auto-columns: 64px; gap: 8px; padding: 10px 12px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.detail-thumbnail { width: 64px; height: 64px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.detail-thumbnail:hover, .detail-thumbnail.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.detail-thumbnail img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qc-photo-strip { border-top: 1px solid var(--line); padding-top: 10px; }
.qc-photo-strip > strong { display: block; padding: 0 12px 7px; color: var(--muted); font-size: 12px; }
.qc-thumbnails { border-top: 0; padding-top: 0; }
.qc-photo-placeholder { display: grid; place-items: center; color: #8d969b; border-style: dashed; background: #fafbfb; font-size: 10px; font-weight: 700; }
.detail-copy { padding: 52px 40px 38px; display: flex; flex-direction: column; overflow-y: auto; }
.detail-badges { display: flex; gap: 7px; }
.detail-badge { border-radius: 13px; padding: 4px 9px; font-size: 11px; font-weight: 750; background: var(--soft); }
.detail-badge.brand { color: var(--accent-dark); background: var(--accent-soft); }
.detail-copy h2 { font-size: 29px; margin: 18px 0 10px; }
.detail-copy .detail-price { font-size: 30px; font-weight: 850; margin: 0 0 18px; }
.detail-description { color: var(--muted); margin: 0 0 20px; }
.variant-picker { border-top: 1px solid var(--line); padding: 15px 0 4px; }
.variant-group { margin-bottom: 14px; }
.variant-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 12px; }
.variant-label span { color: var(--muted); }
.color-options, .size-options { display: flex; flex-wrap: wrap; gap: 7px; }
.sku-options { display: flex; flex-wrap: wrap; gap: 7px; }
.sku-value-option { min-height: 34px; min-width: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 700; }
.sku-value-option.has-image { height: 52px; padding: 4px 8px 4px 4px; }
.sku-value-option img { width: 42px; height: 42px; object-fit: cover; border-radius: 3px; }
.sku-value-option:hover, .sku-value-option.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sku-value-option:disabled { cursor: not-allowed; color: #a4aaad; background: #f2f3f3; border-color: #e3e6e7; box-shadow: none; }
.sku-sync-state { min-height: 54px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.sku-sync-state svg { width: 18px; height: 18px; }
.sku-sync-state:not(.is-error) svg { color: var(--accent); animation: spin 1.2s linear infinite; }
.sku-sync-state.is-error { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
.color-option, .size-option { min-height: 34px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.color-option { padding: 0 9px; gap: 6px; font-size: 12px; }
.color-option > span { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(23,26,31,.2); background: var(--swatch); }
.size-option { min-width: 39px; padding: 0 8px; font-weight: 700; font-size: 12px; }
.color-option:hover, .size-option:hover, .color-option.is-selected, .size-option.is-selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.size-option:disabled { cursor: not-allowed; color: #a4aaad; background: #f2f3f3; text-decoration: line-through; border-color: #e3e6e7; box-shadow: none; }
.detail-facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.detail-fact { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-fact:last-child { border-bottom: 0; }
.detail-fact span { color: var(--muted); }
.detail-actions { margin-top: auto; display: flex; align-items: center; gap: 9px; }
.detail-actions .primary-button { height: 46px; flex: 1 1 auto; }
.detail-actions .secondary-button { height: 46px; flex: 0 0 auto; }
.detail-actions .icon-button { width: 46px; height: 46px; }
.close-glyph { font-size: 25px; line-height: 1; font-weight: 300; }
.share-glyph { position: relative; width: 20px; height: 20px; display: block; }
.share-glyph::before, .share-glyph::after { content: ""; position: absolute; left: 5px; width: 10px; height: 1.5px; background: currentColor; transform-origin: left center; }
.share-glyph::before { top: 8px; transform: rotate(-27deg); }
.share-glyph::after { top: 12px; transform: rotate(27deg); }
.share-glyph > span, .share-glyph > span::before, .share-glyph > span::after { position: absolute; width: 5px; height: 5px; border: 1.5px solid currentColor; border-radius: 50%; background: #fff; box-sizing: border-box; }
.share-glyph > span { left: 1px; top: 8px; }
.share-glyph > span::before, .share-glyph > span::after { content: ""; left: 11px; }
.share-glyph > span::before { top: -7px; }
.share-glyph > span::after { top: 7px; }
.platform-dialog { width: min(540px, calc(100% - 28px)); border-radius: 8px; padding: 30px; }
.platform-dialog-head { padding-right: 38px; }
.platform-dialog-head h2 { font-size: 26px; }
.platform-dialog-head > p:last-child { color: var(--muted); margin: 7px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform-list { display: grid; gap: 8px; margin: 22px 0 18px; }
.platform-row { min-height: 66px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.platform-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.platform-row img { width: 44px; height: 44px; object-fit: contain; border-radius: 5px; background: #fff; border: 1px solid var(--line); }
.platform-row .platform-logo-fallback { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #f6f8f8; color: var(--ink); font-size: 11px; font-weight: 800; }
.platform-row strong { flex: 1; }
.platform-row span { color: var(--muted); font-size: 12px; }
.sponsored-note { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 12px; margin: 0; }
.sponsored-note svg { width: 16px; height: 16px; margin-top: 1px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; min-height: 48px; padding: 0 15px; border-radius: 6px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 9px; box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast svg { color: #56d99e; }
.drawer-backdrop { display: none; }

@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .import-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .site-header { display: flex; padding: 0 16px; justify-content: space-between; }
  .main-nav { grid-column: 1 / -1; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 58px; background: #fff; border-top: 1px solid var(--line); justify-content: center; }
  .nav-button { flex: 1; max-width: 190px; justify-content: center; flex-direction: column; gap: 2px; padding: 5px; font-size: 11px; }
  .nav-button::after { top: -1px; bottom: auto; left: 20%; right: 20%; }
  .header-actions { min-width: 0; }
  .header-select svg { display: block; width: 14px; height: 14px; flex: 0 0 14px; }
  .header-select { padding-left: 4px; }
  .currency-select select { width: 58px; }
  .agent-select select { width: 88px; }
  .invite-select select { width: 104px; }
  .language-select { width: 60px; }
  .language-select select { width: 100%; }
  .saved-button span { display: none; }
  .catalog-heading, .admin-header { width: auto; margin-left: 16px; margin-right: 16px; padding-top: 28px; display: block; }
  .search-shell { width: calc(100vw - 32px); max-width: calc(100vw - 32px); margin-top: 22px; }
  .ad-carousel, .category-strip, .catalog-layout, .stats-row, .admin-tabs, .admin-panel { width: auto; margin-left: 16px; margin-right: 16px; }
  .category-strip { display: block; }
  .desktop-category-strip { display: none; }
  .mobile-quick-filters { display: grid; gap: 10px; }
  .mobile-filter-row { min-width: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: center; }
  .mobile-filter-row > strong { color: var(--ink); font-size: 12px; line-height: 30px; }
  .mobile-filter-options { min-width: 0; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
  .mobile-filter-options::-webkit-scrollbar { display: none; }
  .mobile-filter-chip { flex: 0 0 auto; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; }
  .mobile-filter-chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
  .catalog-layout { display: block; }
  .catalog-results { padding-left: 0; }
  .filter-panel { position: fixed; z-index: 80; top: 0; bottom: 0; right: 0; width: min(360px, 88vw); padding: 18px; background: #fff; border: 0; overflow-y: auto; transform: translateX(105%); transition: transform .23s ease; }
  .filter-panel.is-open { transform: translateX(0); }
  .filter-mobile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
  .drawer-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(23,26,31,.5); }
  .drawer-backdrop.is-open { display: block; }
  .product-grid { width: 100%; grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .management-row, .platform-management .management-row { grid-template-columns: 1fr auto; }
  .management-meta, .template-code { grid-column: 1 / -1; }
  .management-count { grid-column: 2; grid-row: 1; }
  .management-actions { grid-column: 2; grid-row: 2; }
  .product-detail { grid-template-columns: 1fr; }
  .detail-gallery { width: 100%; height: auto; min-height: 0; aspect-ratio: 1 / 1; }
  .detail-gallery img { min-height: 0; aspect-ratio: auto; object-fit: contain; }
  .detail-thumbnails { grid-auto-columns: 56px; padding: 8px 10px; }
  .detail-thumbnail { width: 56px; height: 56px; }
  .detail-copy { padding: 30px 24px 24px; }
  body { padding-bottom: 0; }
}

@media (max-width: 560px) {
  h1 { display: block; max-width: 300px; font-size: 28px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .catalog-heading { width: calc(100vw - 32px) !important; max-width: calc(100vw - 32px) !important; padding-bottom: 21px; }
  .catalog-heading > div { width: 100%; min-width: 0; max-width: 100%; }
  .ad-carousel { width: calc(100vw - 32px) !important; max-width: calc(100vw - 32px) !important; min-width: 0; margin-bottom: 20px; }
  .ad-carousel-viewport { aspect-ratio: 15 / 4; min-height: 0; }
  .ad-carousel-slide img { max-width: 100%; object-fit: contain; }
  .ad-carousel.has-mobile-banners .ad-carousel-viewport { aspect-ratio: 3 / 2; }
  .ad-carousel-slide.has-mobile-image img { object-fit: cover; }
  .catalog-layout { width: calc(100vw - 32px) !important; max-width: calc(100vw - 32px) !important; min-width: 0; }
  .catalog-results { width: 100%; max-width: 100%; min-width: 0; padding-left: 0; overflow: hidden; }
  .results-toolbar { min-width: 0; max-width: 100%; overflow: hidden; }
  .product-grid { width: 100%; max-width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heading-copy { font-size: 14px; }
  .category-strip { margin-bottom: 16px; }
  .catalog-results { padding-top: 14px; }
  .product-grid { gap: 10px; }
  .catalog-pagination { gap: 4px; margin-top: 22px; }
  .pagination-page { width: 34px; height: 34px; }
  .pagination-nav { min-width: 84px; height: 34px; padding: 0 8px; font-size: 11px; }
  .product-body { padding: 10px; }
  .product-meta { font-size: 9px; }
  .product-title { font-size: 13px; height: 38px; margin-bottom: 8px; }
  .price { font-size: 17px; }
  .buy-button { width: 60px; height: 34px; padding: 0 7px; font-size: 10px; }
  .site-header { padding-left: 10px; padding-right: 10px; }
  .brand { flex: 0 0 132px; gap: 5px; min-width: 0; }
  .brand-name { font-size: 15px; }
  .header-actions { position: absolute; left: 180px; right: 10px; top: 17px; width: auto; flex: none; min-width: 0; gap: 2px; justify-content: flex-end; overflow: visible; }
  .saved-button { display: none; }
  .header-select { min-width: 0; padding: 0 3px; overflow: hidden; flex: 0 0 auto; }
  .header-select select { width: 100%; max-width: 100%; padding-left: 2px; padding-right: 17px; }
  .currency-select { width: 44px; }
  .language-select { width: 40px; }
  .agent-select { width: 58px; }
  .header-select select { font-size: 10px; padding-right: 8px; }
  .mobile-filter-button { width: 30px; height: 34px; flex-basis: 30px; }
  .mobile-filter-button { width: 34px; height: 34px; flex: 0 0 34px; }
  .stock-badge { font-size: 9px; }
  .results-toolbar { align-items: flex-start; }
  .select-label { font-size: 0; }
  .select-label select { font-size: 13px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-item { padding: 13px 10px; gap: 8px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-item strong { font-size: 19px; }
  .admin-header .status-pill { margin-top: 17px; width: max-content; }
  .panel-heading { align-items: flex-start; }
  .panel-heading .primary-button { flex: 0 0 auto; padding: 0 10px; }
  .panel-heading .primary-button svg + * { display: none; }
  .import-tool { padding: 15px; }
  .import-settings { grid-template-columns: 1fr; gap: 12px; }
  .inline-create { flex-direction: column; }
  .inline-create input, .inline-create select { min-height: 40px; width: 100%; }
  .settings-field { grid-template-columns: 1fr; }
  .logo-upload-control { align-items: flex-start; flex-direction: column; }
  .logo-upload-actions input[type="file"] { width: 100%; }
  .settings-section:first-child .settings-field input { width: 100%; }
  .product-dialog { max-height: calc(100vh - 20px); }
  .detail-copy h2 { font-size: 23px; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions .primary-button { min-width: calc(100% - 55px); order: 1; }
  .detail-actions .icon-button { order: 2; }
  .detail-actions .secondary-button { flex: 1 1 100%; order: 3; }
  .platform-dialog { padding: 24px 18px; }
  .toast { left: 14px; right: 14px; bottom: 72px; }
}

@media (max-width: 600px) {
  :root { --header-height: 126px; }
  .site-header {
    height: var(--header-height);
    padding: 10px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 38px 40px;
    gap: 8px 10px;
    align-content: center;
  }
  .brand { grid-column: 1; grid-row: 1; flex: 0 1 auto; }
  .brand-name { display: inline; font-size: 16px; }
  .site-header { height: var(--header-height); grid-template-rows: 48px 40px; }
  .brand-mark.has-logo { width: 98px; height: 52px; }
  .header-actions {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: grid;
    grid-template-columns: 54px 64px minmax(96px, 1fr) minmax(96px, 1fr);
    gap: 6px;
  }
  .header-select, .language-select, .currency-select, .agent-select, .invite-select {
    width: 100%;
    height: 38px;
    min-width: 0;
    padding: 0 4px;
    overflow: hidden;
    gap: 3px;
  }
  .header-select svg { display: block; width: 14px; height: 14px; flex: 0 0 14px; }
  .header-select select, .language-select select, .currency-select select, .agent-select select, .invite-select select {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    height: 36px;
    padding: 0 18px 0 6px;
    font-size: 11px;
  }
  .saved-button { display: none; }
  .catalog-heading { padding-top: 22px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { width: 100%; min-width: 0; }
  .product-title { height: 38px; min-height: 38px; font-size: 13px; }
  .product-meta { font-size: 9px; }
  .product-body { padding: 10px; }
  .results-toolbar { gap: 10px; align-items: center; }
  .results-toolbar p { flex: 0 0 auto; }
  .select-label { min-width: 0; margin-left: auto; }
  .select-label select { width: 148px; max-width: 42vw; }
  .product-dialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .product-detail { display: block; width: 100%; max-width: 100%; max-height: none; }
  .detail-gallery-shell { width: 100%; max-width: 100%; }
  .detail-gallery { width: 100%; aspect-ratio: 1 / 1; }
  .detail-thumbnails { grid-auto-columns: 58px; padding: 8px 10px; }
  .detail-thumbnail { width: 58px; height: 58px; }
  .detail-copy { width: 100%; max-width: 100%; padding: 24px 18px 32px; overflow: visible; }
  .detail-copy h2 { max-width: 100%; font-size: 23px; overflow-wrap: anywhere; }
  .detail-copy .detail-price { font-size: 27px; }
  .sku-options { gap: 6px; }
  .sku-value-option { max-width: 100%; }
  .detail-actions { width: 100%; }
  .detail-actions .primary-button { min-width: calc(100% - 55px); }
  .dialog-close { position: fixed; top: 10px; right: 10px; }
}

@media (max-width: 360px) {
  .site-header { padding-left: 10px; padding-right: 10px; }
  .header-actions { grid-template-columns: 50px 56px minmax(86px, 1fr) minmax(86px, 1fr); gap: 4px; }
  .mobile-filter-row { grid-template-columns: 70px minmax(0, 1fr); gap: 6px; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-title { height: 38px; min-height: 38px; }
}

@media (hover: none) and (pointer: coarse) {
  .category-strip { display: block; width: auto; margin-left: 16px; margin-right: 16px; }
  .desktop-category-strip { display: none; }
  .mobile-quick-filters { display: grid; gap: 10px; }
  .mobile-filter-row { min-width: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: center; }
  .mobile-filter-row > strong { font-size: 12px; line-height: 30px; }
  .mobile-filter-options { min-width: 0; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
  .mobile-filter-options::-webkit-scrollbar { display: none; }
  .mobile-filter-chip { flex: 0 0 auto; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; }
  .mobile-filter-chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
  .catalog-layout { display: block; }
  .catalog-results { padding-left: 0; }
  .filter-panel { position: fixed; z-index: 80; top: 0; bottom: 0; right: 0; width: min(360px, 88vw); padding: 18px; background: #fff; border: 0; overflow-y: auto; transform: translateX(105%); }
}

.mobile-device .category-strip { display: block; width: auto; margin-left: 16px; margin-right: 16px; }
.mobile-device .desktop-category-strip { display: none; }
.mobile-device .mobile-quick-filters { display: grid; gap: 10px; }
.mobile-device .mobile-filter-row { min-width: 0; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: center; }
.mobile-device .mobile-filter-options { min-width: 0; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.mobile-device .mobile-filter-options::-webkit-scrollbar { display: none; }
.mobile-device .filter-panel { position: fixed; z-index: 80; top: 0; bottom: 0; right: 0; width: min(360px, 88vw); padding: 18px; background: #fff; border: 0; overflow-y: auto; transform: translateX(105%); }
.mobile-device .catalog-layout { display: block; }

.mobile-subcategory-row > strong { color: var(--accent-dark); }

/* Storefront UI refinement */
.site-header { box-shadow: 0 1px 0 rgba(23,26,31,.03); }
.brand-mark { border-radius: 3px; }
.catalog-heading { padding-top: 46px; padding-bottom: 34px; }
.catalog-heading h1 { max-width: 760px; font-size: clamp(32px, 3.2vw, 46px); }
.heading-copy { font-size: 15px; line-height: 1.55; }
.search-shell { box-shadow: 0 3px 14px rgba(23,26,31,.04); }
.catalog-layout { border-top-color: #e7eaec; grid-template-columns: 238px minmax(0, 1fr); }
.filter-panel { padding-right: 24px; position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 108px); overflow-y: auto; scrollbar-width: thin; }
.filter-section { padding-bottom: 20px; margin-bottom: 20px; }
.filter-title { font-size: 13px; }
.filter-option { min-height: 30px; font-size: 13px; }
.catalog-results { padding-top: 20px; }
.results-toolbar { padding-bottom: 12px; border-bottom: 1px solid #eef0f1; }
.results-toolbar p { font-size: 14px; }
.select-label { font-size: 12px; }
.select-label select { min-width: 148px; border-color: #c8ced1; }
.product-grid { gap: 16px; margin-top: 18px; }
.product-card { border-color: #e1e5e7; border-radius: 6px; box-shadow: 0 2px 8px rgba(23,26,31,.025); }
.product-image-wrap { background: #f8faf9; }
.product-body { padding: 14px 14px 15px; }
.product-meta { font-size: 10px; letter-spacing: 0; }
.product-title { font-size: 14px; font-weight: 720; margin-top: 8px; }
.product-stats { color: #7a8389; font-size: 11px; }
.price { font-size: 20px; }
.social-button { min-height: 36px; background: #fff; box-shadow: 0 1px 2px rgba(23,26,31,.03); }
.detail-badge { border-radius: 5px; }
.product-dialog { box-shadow: 0 24px 70px rgba(23,26,31,.22); }
.detail-copy { padding-left: 38px; padding-right: 38px; }
.qc-photo-strip { background: #fbfcfc; }

@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .catalog-heading { padding-top: 28px; padding-bottom: 22px; }
  .catalog-heading h1 { font-size: 30px; max-width: 330px; }
  .heading-copy { width: calc(100vw - 32px); max-width: calc(100vw - 32px); font-size: 14px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  .search-shell { margin-top: 20px; }
  .ad-carousel { width: auto; margin-left: 16px; margin-right: 16px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); padding: 18px; max-height: none; overflow-y: auto; transform: translateX(105%); }
  .filter-panel.is-open { transform: translateX(0); }
  .catalog-results { padding-top: 14px; }
  .product-grid { gap: 10px; margin-top: 12px; }
  .product-body { padding: 10px; }
  .product-title { font-size: 13px; }
  .price { font-size: 18px; }
  .mobile-brand-search { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: center; margin-top: 4px; }
  .mobile-brand-search > span { font-size: 12px; color: var(--muted); }
}

/* Floating WhatsApp contact */
.social-links {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 75;
  display: block;
  margin: 0;
}
.social-links .social-button.whatsapp {
  width: 58px;
  height: 58px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, .28);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.social-links .social-button.whatsapp:hover {
  border: 0;
  background: #1fbd5b;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37, 211, 102, .36);
}
.social-links .social-button.whatsapp:focus-visible {
  outline: 3px solid rgba(37, 211, 102, .35);
  outline-offset: 3px;
}
.social-links .social-button.whatsapp .social-mark {
  width: 35px;
  height: 35px;
  background: transparent;
  display: grid;
  place-items: center;
}
.social-links .social-button.whatsapp .social-mark svg {
  display: block;
  width: 35px;
  height: 35px;
  fill: currentColor;
}
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .social-links {
    right: 16px;
    bottom: 76px;
  }
}

/* Icon-only header selectors */
.header-select,
.language-select,
.currency-select,
.agent-select,
.invite-select {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  gap: 0;
  overflow: visible;
}
.header-select::after { display: none; }
.header-select svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  pointer-events: none;
}
.header-select select,
.language-select select,
.currency-select select,
.agent-select select,
.invite-select select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  max-width: none;
  height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
@media (max-width: 600px) {
  .header-actions {
    grid-template-columns: repeat(4, 40px);
    justify-content: end;
    gap: 8px;
  }
  .header-select,
  .language-select,
  .currency-select,
  .agent-select,
  .invite-select {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
  }
  .header-select svg { width: 18px; height: 18px; flex-basis: 18px; }
}

/* Mobile catalog order: banner before search */
@media (max-width: 560px) {
  #catalogView {
    display: flex;
    flex-direction: column;
  }
  #catalogView > .catalog-heading {
    display: contents;
  }
  #catalogView > .catalog-heading > div:first-child {
    order: 1;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: 0 16px;
    padding-top: 22px;
    padding-bottom: 8px;
  }
  #catalogView > .ad-carousel { order: 2; }
  #catalogView > .catalog-heading > .search-shell {
    order: 3;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: 0 16px 20px;
  }
  #catalogView > .category-strip { order: 4; }
  #catalogView > .catalog-layout { order: 5; }
}

/* Mobile viewport containment */
@media (max-width: 560px) {
  html,
  body,
  #catalogView {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .mobile-filter-options,
  .mobile-device .mobile-filter-options {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    align-content: initial;
  }
  .mobile-filter-chip {
    flex: 0 0 auto;
  }
  .filter-panel {
    visibility: hidden;
    pointer-events: none;
  }
  .filter-panel.is-open {
    visibility: visible;
    pointer-events: auto;
  }
}


/* Floating WhatsApp + Telegram contact buttons */
.social-links { display: flex; gap: 10px; align-items: center; }
.social-links .social-button.whatsapp,
.social-links .social-button.telegram { width: 58px; height: 58px; min-height: 0; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease; }
.social-links .social-button.telegram { background: #168dcc; box-shadow: 0 8px 22px rgba(22, 141, 204, .28); }
.social-links .social-button.telegram:hover { border: 0; background: #0f79b1; color: #fff; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 141, 204, .36); }
.social-links .social-button.telegram .social-mark { width: 35px; height: 35px; background: transparent; display: grid; place-items: center; }
.social-links .social-button.telegram .social-mark svg { display: block; width: 35px; height: 35px; fill: currentColor; }
