.marketplace-prototype {
  --market-accent: #167da5;
  --market-accent-dark: #126988;
  --market-ink: #20262a;
  --market-muted: #687178;
  --market-line: #dfe5e8;
  --market-soft: #f5f8f9;
}

.marketplace-prototype .marketplace-heading {
  margin: 22px 0 30px;
}

.marketplace-prototype .marketplace-heading h1 { margin: 0; }

.marketplace-prototype .catalog-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 30px; }
.marketplace-prototype .catalog-tree-wrap,
.marketplace-prototype .catalog-filter { border-radius: 10px; overflow: hidden; }
.marketplace-prototype .catalog-tree a { padding-block: 13px; }
.marketplace-prototype .catalog-filter { padding: 20px; background: #fff; box-shadow: 0 8px 30px rgb(28 44 52 / 7%); }
.marketplace-prototype .catalog-filter fieldset > label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: 32px; margin: 4px 0; cursor: pointer; }
.marketplace-prototype .catalog-filter fieldset > label small { color: #8a9398; font-size: 11px; }
.marketplace-prototype .catalog-filter input[type="radio"] { width: 18px; height: 18px; accent-color: var(--market-accent); }
.marketplace-prototype .catalog-filter .filter-actions { align-items: stretch; flex-direction: column; }
.marketplace-prototype .catalog-filter .filter-actions .button { width: 100%; min-height: 44px; }
.marketplace-prototype .catalog-filter .filter-actions a { min-height: 32px; text-align: center; }

.marketplace-prototype .catalog-toolbar {
  min-height: 64px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--market-line);
  border-radius: 10px;
  background: #fff;
}

.marketplace-prototype .marketplace-results { display: flex; align-items: center; gap: 12px; color: var(--market-muted); white-space: nowrap; }
.marketplace-prototype .marketplace-results strong { color: var(--market-ink); }
.marketplace-prototype .marketplace-results button { display: none; }
.marketplace-prototype .catalog-sort-form { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.marketplace-prototype .catalog-sort-label { color: var(--market-muted); font-size: 12px; }
.marketplace-prototype .catalog-toolbar select { min-width: 220px; border-radius: 8px; }
.marketplace-prototype .display-switch { border-radius: 8px; overflow: hidden; }
.marketplace-prototype .display-switch a { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.marketplace-prototype .display-switch__icon { font-size: 16px; line-height: 1; }

.marketplace-prototype .marketplace-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.marketplace-prototype .marketplace-filter-chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid #cfd9de; border-radius: 999px; background: #fff; color: #354047; font-size: 12px; }
.marketplace-prototype .marketplace-filter-chips a:hover { border-color: var(--market-accent); text-decoration: none; }
.marketplace-prototype .marketplace-filter-chips span { margin-left: 5px; font-size: 18px; line-height: 1; }
.marketplace-prototype .marketplace-filter-chips .marketplace-filter-chips__reset { border-color: transparent; color: var(--market-accent-dark); }

.marketplace-prototype .catalog-products--table { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border: 0; }
.marketplace-prototype .catalog-products--table .catalog-product--marketplace {
  min-width: 0;
  min-height: 485px;
  padding: 14px;
  border: 1px solid var(--market-line);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgb(28 44 52 / 5%);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.marketplace-prototype .catalog-products--table .catalog-product--marketplace:hover { border-color: #bdcbd1; box-shadow: 0 10px 30px rgb(28 44 52 / 10%); transform: translateY(-2px); }
.marketplace-prototype .catalog-products--table .catalog-product__media > a { min-height: 190px; }
.marketplace-prototype .catalog-products--table .catalog-product__media img { height: 180px; object-fit: contain; }
.marketplace-prototype .catalog-products--table .catalog-product__content { display: flex; flex: 1; flex-direction: column; }
.marketplace-prototype .catalog-products--table .catalog-product h2 { min-height: 42px; margin: 12px 0 8px; font-size: 16px; line-height: 1.3; }
.marketplace-prototype .catalog-products--table .product-meta { align-items: center; margin-bottom: 12px; }
.marketplace-prototype .catalog-products--table .product-meta span { padding: 4px 7px; border-radius: 5px; background: #eef3f5; }
.marketplace-prototype .catalog-products--table .product-characteristics { display: grid; gap: 4px; margin: 0 0 15px; color: #58636a; font-size: 12px; }
.marketplace-prototype .catalog-products--table .catalog-product__buy { width: 100%; margin-top: auto; }
.marketplace-prototype .catalog-products--table .catalog-price { min-height: 31px; margin: 0 0 12px; }
.marketplace-prototype .catalog-products--table .catalog-price strong { font-size: 20px; }
.marketplace-prototype .catalog-products--table .catalog-product__buy form { grid-template-columns: 1fr; }
.marketplace-prototype .catalog-products--table .catalog-product__buy .button,
.marketplace-prototype .marketplace-inquiry { width: 100%; min-height: 44px; display: grid; place-items: center; padding: 9px 10px; text-align: center; }
.marketplace-prototype .product-badges { gap: 5px; }
.marketplace-prototype .product-badges span { border-radius: 4px; }

.marketplace-prototype .catalog-products--list { border-top: 0; display: grid; gap: 12px; }
.marketplace-prototype .catalog-products--list .catalog-product--marketplace { border: 1px solid var(--market-line); border-radius: 12px; }
.marketplace-prototype .catalog-products--price { border-top: 0; display: grid; gap: 8px; }
.marketplace-prototype .catalog-products--price .catalog-product--marketplace { border: 1px solid var(--market-line); border-radius: 10px; }
.marketplace-prototype .catalog-pagination { margin-top: 20px; border: 0; }
.marketplace-prototype .catalog-pagination > div a { min-width: 40px; height: 40px; border-radius: 8px; }
.marketplace-prototype .category-description { margin-top: 54px; padding-top: 32px; border-top: 1px solid var(--market-line); }

.marketplace-filter-sheet { width: 100%; max-width: none; height: min(88vh, 760px); max-height: none; margin: auto 0 0; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: #fff; }
.marketplace-filter-sheet::backdrop { background: rgb(17 26 31 / 58%); }
.marketplace-filter-sheet__panel { display: flex; height: 100%; flex-direction: column; }
.marketplace-filter-sheet__panel > header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 16px; border-bottom: 1px solid #e1e7ea; }
.marketplace-filter-sheet__panel > header h2 { margin: 0; font-size: 22px; }
.marketplace-filter-sheet__panel > header button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f0f4f5; font-size: 28px; line-height: 1; }
.marketplace-filter-sheet .catalog-filter { flex: 1; margin: 0; padding: 0 16px 18px; overflow-y: auto; border: 0; background: #fff; }
.marketplace-filter-sheet .catalog-filter fieldset { padding: 18px 0; }
.marketplace-filter-sheet .catalog-filter fieldset > label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 42px; margin: 2px 0; font-size: 15px; }
.marketplace-filter-sheet .catalog-filter fieldset > label small { color: #7c878d; }
.marketplace-filter-sheet .catalog-filter input[type="radio"] { width: 20px; height: 20px; accent-color: #167da5; }
.marketplace-filter-sheet .range-fields input { min-height: 46px; border-radius: 8px; font-size: 16px; }
.marketplace-filter-sheet .filter-actions { position: sticky; bottom: -18px; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e1e7ea; background: #fff; }
.marketplace-filter-sheet .filter-actions .button { min-height: 48px; }
.marketplace-filter-sheet .filter-actions a { min-height: 44px; display: grid; place-items: center; padding-inline: 8px; }

.marketplace-prototype :is(a, button, input, select):focus-visible,
.marketplace-filter-sheet :is(a, button, input, select):focus-visible { outline: 3px solid rgb(22 125 165 / 32%); outline-offset: 2px; }

@media (max-width: 1100px) {
  .marketplace-prototype .catalog-products--table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .marketplace-prototype .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .marketplace-prototype .catalog-content { width: 100%; min-width: 0; }
  .marketplace-prototype .catalog-toolbar { position: sticky; top: 0; z-index: 12; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; box-shadow: 0 5px 18px rgb(28 44 52 / 9%); }
  .marketplace-prototype .marketplace-results { grid-column: 1 / -1; justify-content: space-between; }
  .marketplace-prototype .marketplace-results button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 14px; border: 1px solid var(--market-accent); border-radius: 8px; background: #fff; color: var(--market-accent-dark); font: inherit; font-weight: 700; }
  .marketplace-prototype .catalog-sort-form { display: block; margin: 0; }
  .marketplace-prototype .catalog-sort-label { display: none; }
  .marketplace-prototype .catalog-toolbar select { width: 100%; min-width: 0; }
  .marketplace-prototype .display-switch { min-width: 0; }
  .marketplace-prototype .display-switch a { min-width: 0; padding-inline: 9px; font-size: 0; }
  .marketplace-prototype .display-switch__icon { font-size: 18px; }
  .marketplace-prototype .display-switch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 600px) {
  .marketplace-prototype { padding-top: 18px; }
  .marketplace-prototype .breadcrumbs { min-height: 32px; align-items: center; overflow: visible; font-size: 13px; white-space: normal; }
  .marketplace-prototype .breadcrumbs > span { display: none; }
  .marketplace-prototype .breadcrumbs > span:nth-last-child(2) { display: inline-flex; min-width: 0; }
  .marketplace-prototype .breadcrumbs > span:nth-last-child(2) a { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: var(--market-accent-dark); font-weight: 700; }
  .marketplace-prototype .breadcrumbs > span:nth-last-child(2) a::before { content: '←'; flex: 0 0 auto; font-size: 18px; line-height: 1; }
  .marketplace-prototype .breadcrumbs > span:nth-last-child(2) a span { overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
  .marketplace-prototype .marketplace-heading { margin: 10px 0 20px; }
  .marketplace-prototype .marketplace-heading h1 { font-size: 29px; }
  .marketplace-prototype .catalog-toolbar { margin-inline: 0; padding: 10px; border: 0; border-radius: 12px; background: var(--market-soft); box-shadow: 0 8px 24px rgb(28 44 52 / 7%); }
  .marketplace-prototype .marketplace-results { font-size: 14px; }
  .marketplace-prototype .marketplace-results button { min-height: 44px; border-color: #b8d6e2; background: #fff; }
  .marketplace-prototype .catalog-toolbar select { min-height: 48px; border-color: #d6e0e4; border-radius: 9px; font-size: 14px; }
  .marketplace-prototype .display-switch { min-height: 48px; border-color: #d6e0e4; border-radius: 9px; background: #fff; }
  .marketplace-prototype .display-switch a { min-height: 46px; }
  .marketplace-prototype .catalog-products--table { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .marketplace-prototype .catalog-products--table .catalog-product--marketplace { min-height: 0; padding: 16px; border-radius: 12px; box-shadow: 0 8px 24px rgb(28 44 52 / 7%); }
  .marketplace-prototype .catalog-products--table .catalog-product--marketplace:hover { transform: none; }
  .marketplace-prototype .catalog-products--table .catalog-product__media { overflow: hidden; border-radius: 8px; background: var(--market-soft); }
  .marketplace-prototype .catalog-products--table .catalog-product__media > a { min-height: 160px; }
  .marketplace-prototype .catalog-products--table .catalog-product__media img { width: calc(100% - 28px); height: 142px; }
  .marketplace-prototype .catalog-products--table .catalog-product h2 { min-height: 0; margin: 16px 0 10px; font-size: 17px; line-height: 1.35; }
  .marketplace-prototype .catalog-products--table .product-meta { align-items: center; flex-direction: row; gap: 10px; margin-bottom: 12px; font-size: 12px; }
  .marketplace-prototype .catalog-products--table .product-characteristics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; margin: 0 0 18px; font-size: 14px; line-height: 1.45; }
  .marketplace-prototype .catalog-products--table .product-characteristics div { display: block; min-width: 0; padding: 10px; border-radius: 8px; background: var(--market-soft); }
  .marketplace-prototype .catalog-products--table .product-characteristics div:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .marketplace-prototype .catalog-products--table .catalog-product__buy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(144px, .9fr); align-items: end; gap: 12px; }
  .marketplace-prototype .catalog-products--table .catalog-price { align-items: flex-start; flex-direction: column; gap: 2px; min-height: 0; margin: 0; }
  .marketplace-prototype .catalog-products--table .catalog-price strong { font-size: 21px; }
  .marketplace-prototype .catalog-products--table .catalog-price del { font-size: 12px; }
  .marketplace-prototype .catalog-products--table .catalog-product__buy .button,
  .marketplace-prototype .marketplace-inquiry { min-height: 48px; font-size: 14px; }
  .marketplace-prototype .product-badges span { padding: 4px 7px; font-size: 10px; }
  .marketplace-prototype .marketplace-filter-chips { flex-wrap: nowrap; margin-inline: -16px; padding-inline: 16px; overflow-x: auto; scrollbar-width: none; }
  .marketplace-prototype .marketplace-filter-chips::-webkit-scrollbar { display: none; }
  .marketplace-prototype .marketplace-filter-chips a { flex: 0 0 auto; min-height: 40px; }
  .marketplace-prototype .catalog-products--list { gap: 12px; }
  .marketplace-prototype .catalog-products--list .catalog-product--marketplace { padding: 14px; }
}

/* Video in product gallery */
/* Video thumbnail and player in product gallery */
.product-gallery__thumbs button[data-gallery-video] { display: grid; place-items: center; color: #555; background: #f0f0f0; }
.product-gallery__thumbs button[data-gallery-video][aria-current=true] { border-color: #4d88aa; color: #4d88aa; background: #e8f4f8; }
.product-gallery__main-video { grid-column: 2; grid-row: 1; width: 100%; max-height: 360px; object-fit: contain; background: #000; }
@media (max-width: 600px) { .product-gallery__main-video { grid-column: 1; grid-row: 1; max-height: 320px; } }

@media (prefers-reduced-motion: reduce) {
  .marketplace-prototype .catalog-products--table .catalog-product--marketplace { transition: none; }
}
