:root {
  --b24-polish-blue: var(--color-primary);
  --b24-polish-blue-dark: var(--color-primary-dark);
  --b24-polish-ink: var(--color-ink);
  --b24-polish-muted: var(--color-muted);
  --b24-polish-line: var(--color-border);
  --b24-polish-surface: var(--color-surface);
  --b24-polish-soft: var(--color-surface-soft);
  --b24-polish-success: var(--color-success);
  --b24-polish-danger: var(--color-danger);
  --b24-polish-radius: var(--radius-lg);
  --b24-polish-shadow: var(--shadow-sm);
  --b24-polish-shadow-hover: var(--shadow-lg);
  --b24-polish-ease: var(--ease-standard);
}

html {
  scroll-behavior: smooth;
}
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a,
.ad-card,
.ads-slider-card,
.section,
.b24-related-card,
.seller-summary-card,
.seller-ads-panel {
  transition:
    transform 0.24s var(--b24-polish-ease),
    box-shadow 0.24s var(--b24-polish-ease),
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

button:not(:disabled):active,
.show-more-btn:active,
.apply-filter-btn:active {
  transform: scale(0.975);
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(52, 118, 196, 0.24);
  outline-offset: 2px;
}

:where(input, select, textarea):focus {
  border-color: rgba(52, 118, 196, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(52, 118, 196, 0.09) !important;
}

.ad-card,
.ads-slider-card,
.b24-related-card {
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .ad-card:hover,
  .ads-slider-card:hover,
  .b24-related-card:hover,
  .seller-profile-page .ad-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--b24-polish-shadow-hover);
  }
}

.ad-image,
.ads-slider-img-wrap,
.image-container,
.b24-related-img,
.seller-avatar-wrap {
  position: relative;
  overflow: hidden;
  background: #edf2f7;
}

.ad-image img,
.ads-slider-img-wrap img,
.image-container > img,
.b24-related-img img,
.seller-page .ad-card > img {
  transform: translateZ(0) scale(1);
  transition:
    transform 0.45s var(--b24-polish-ease),
    opacity 0.28s ease;
}

@media (hover: hover) and (pointer: fine) {
  .ad-card:hover .ad-image img,
  .ads-slider-card:hover .ads-slider-img-wrap img,
  .b24-related-card:hover .b24-related-img img,
  .seller-page .ad-card:hover > img,
  .image-container:hover > img {
    transform: translateZ(0) scale(1.035);
  }
}

img.b24-media-loading {
  opacity: 0.12;
}

img.b24-media-ready {
  opacity: 1;
}

.ad-image:has(img.b24-media-loading)::before,
.ads-slider-img-wrap:has(img.b24-media-loading)::before,
.image-container:has(img.b24-media-loading)::before,
.b24-related-img:has(img.b24-media-loading)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, #edf2f7 20%, #f8fafc 42%, #edf2f7 64%);
  background-size: 240% 100%;
  animation: b24SkeletonShimmer 1.35s ease-in-out infinite;
}

@keyframes b24SkeletonShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.b24-skeleton-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ads-slider-list > .b24-skeleton-grid,
.results-section > .b24-skeleton-grid,
.ads-slider-list > .b24-ui-state,
.results-section > .b24-ui-state {
  grid-column: 1 / -1;
  flex: 1 0 100%;
}

.b24-skeleton-card {
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--b24-polish-line);
  border-radius: var(--b24-polish-radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(31, 55, 82, 0.04);
}

.b24-skeleton-block,
.b24-skeleton-line {
  display: block;
  background: linear-gradient(100deg, #e9eef4 20%, #f8fafc 42%, #e9eef4 64%);
  background-size: 240% 100%;
  animation: b24SkeletonShimmer 1.35s ease-in-out infinite;
}

.b24-skeleton-block {
  height: 165px;
}
.b24-skeleton-body {
  padding: 16px;
}
.b24-skeleton-line {
  height: 12px;
  margin-bottom: 11px;
  border-radius: 999px;
}
.b24-skeleton-line.is-title {
  width: 74%;
  height: 15px;
}
.b24-skeleton-line.is-short {
  width: 46%;
}

.b24-details-skeleton {
  min-height: 640px;
  border: 1px solid var(--b24-polish-line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.b24-details-skeleton .b24-skeleton-block {
  height: 430px;
}
.b24-details-skeleton .b24-skeleton-body {
  padding: 24px;
}

.b24-ui-state,
.b24-related-empty,
.loading-state,
.empty-state,
.b24-state-inline {
  box-sizing: border-box;
  width: 100%;
  min-height: 170px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  color: var(--b24-polish-muted);
  border: 1px dashed #cfd9e5;
  border-radius: var(--b24-polish-radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.b24-ui-state__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf1f8;
  color: var(--b24-polish-blue);
  font-size: 24px;
  font-weight: 900;
}

.b24-ui-state h2,
.b24-ui-state h3 {
  margin: 2px 0 0;
  color: var(--b24-polish-ink);
  font-size: 18px;
}

.b24-ui-state p {
  margin: 0;
  line-height: 1.75;
}
.b24-ui-state--error .b24-ui-state__icon {
  background: #fff0f1;
  color: var(--b24-polish-danger);
}
.b24-ui-state--success .b24-ui-state__icon {
  background: #eaf8f0;
  color: var(--b24-polish-success);
}

.b24-polish-enter {
  animation: b24PolishEnter 0.42s var(--b24-polish-ease) both;
}

@keyframes b24PolishEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.b24-toast-region {
  position: fixed;
  z-index: 2147483600;
  inset-inline-start: 18px;
  bottom: 18px;
  width: min(370px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.b24-toast {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dce5ef;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 45px rgba(20, 42, 68, 0.2);
  color: var(--b24-polish-ink);
  font-size: 13px;
  font-weight: 700;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  animation: b24ToastIn 0.28s var(--b24-polish-ease) both;
}

.b24-toast::before {
  content: "✓";
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  border-radius: 50%;
  background: #e9f8ef;
  color: var(--b24-polish-success);
}

.b24-toast--error::before {
  content: "!";
  background: #fff0f1;
  color: var(--b24-polish-danger);
}
.b24-toast--info::before {
  content: "i";
  background: #eaf1f8;
  color: var(--b24-polish-blue);
}
.b24-toast.is-leaving {
  animation: b24ToastOut 0.2s ease both;
}

@keyframes b24ToastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes b24ToastOut {
  to {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
}
.b24-home-stats {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.b24-stat-card {
  min-height: 86px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #e1e8f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(31, 55, 82, 0.05);
}

.b24-stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 13px;
  background: #eaf1f8;
  color: var(--b24-polish-blue);
  font-size: 20px;
  border: 1px solid #d5e4f3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.b24-stat-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.b24-stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.b24-stat-value {
  color: var(--b24-polish-ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}
.b24-stat-label {
  color: var(--b24-polish-muted);
  font-size: 11px;
  font-weight: 700;
}

.b24-featured-row {
  position: relative;
  border: 1px solid #d5e4f3;
  background: linear-gradient(180deg, rgba(234, 241, 248, 0.72), rgba(255, 255, 255, 0.96));
}

.b24-featured-row[hidden] {
  display: none !important;
}

.b24-featured-row .ads-row-header h2::before {
  content: "★";
  margin-inline-end: 8px;
  color: #f2a014;
  font-size: 0.9em;
}

@media (min-width: 901px) {
  html body #mainAdsSliders #featuredAdsSlider.ads-slider-list {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(4, 280px) !important;
    grid-auto-flow: row !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 16px 0 !important;
    overflow: visible !important;
  }

  html body #mainAdsSliders #featuredAdsSlider > .ads-slider-card.b24-desktop-home-card {
    box-sizing: border-box !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
  }
}

.b24-section-kicker {
  margin: 4px 0 0;
  color: #718399;
  font-size: 11px;
  font-weight: 650;
}
.b24-seller-trust-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.b24-seller-trust-item {
  min-width: 0;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #e3e9f0;
  border-radius: 10px;
  background: #f8fafc;
}

.b24-seller-trust-item small {
  color: #74869a;
  font-size: 9.5px;
  font-weight: 700;
}
.b24-seller-trust-item strong {
  overflow: hidden;
  color: #203b58;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.b24-seller-trust-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.b24-search-page-shell,
body > .search-box {
  width: min(720px, calc(100% - 32px));
  margin: 56px auto 18px;
  padding: 26px;
  border: 1px solid var(--b24-polish-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--b24-polish-shadow);
}

body > .search-box h2 {
  margin: 0 0 18px;
  color: var(--b24-polish-ink);
}
body > .search-box input {
  width: calc(100% - 118px);
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
}
body > .search-box button {
  min-width: 104px;
  min-height: 48px;
  margin-inline-start: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--b24-polish-blue);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
body > #searchResult {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto 52px;
}
body > #searchResult .result {
  padding: 22px;
  border: 1px solid var(--b24-polish-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 55, 82, 0.06);
}

@media (max-width: 900px) {
  .b24-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .b24-skeleton-card {
    min-height: 226px;
  }
  .b24-skeleton-block {
    height: 126px;
  }
  .b24-home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100% - 20px);
    margin: 12px auto 18px;
    gap: 8px;
  }
  .b24-stat-card {
    min-height: 72px;
    padding: 11px;
    gap: 9px;
  }
  .b24-stat-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 16px;
  }
  .b24-stat-value {
    font-size: 16px;
  }
  .b24-stat-label {
    font-size: 9px;
  }
  .b24-toast-region {
    inset-inline: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
  }
  .b24-details-skeleton .b24-skeleton-block {
    height: min(68vw, 390px);
  }
  .b24-search-page-shell,
  body > .search-box {
    margin-top: 24px;
    padding: 18px;
  }
  body > .search-box input {
    width: 100%;
  }
  body > .search-box button {
    width: 100%;
    margin: 10px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
