/**
 * Каталог — сетка polaroid overlap (реф SavvyChic) + палитра Y2K
 */

.catalog-page {
  padding-bottom: 48px;
}

.catalog-hero {
  text-align: center;
  padding: 12px 0 40px;
}

.catalog-hero .sticker-title {
  display: block;
  margin: 0 auto 12px;
  max-width: fit-content;
}

.catalog-hero .sticker-sub {
  margin: 0 auto;
  text-align: center;
}

.catalog-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sky);
  border: 3px solid var(--ink);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: var(--vol-layer-sm);
  margin-left: 12px;
  vertical-align: middle;
  animation: float-b 4s ease-in-out infinite;
}

.polar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 3vw, 22px);
  max-width: 920px;
  margin: 0 auto;
  padding: 0 4px;
}

@media (min-width: 640px) {
  .polar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.polar-tile {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--vol-layer);
  --rot: 0deg;
  animation: float-b 4.8s ease-in-out infinite;
}

.polar-tile:nth-child(3n + 1) {
  --rot: -2deg;
  animation-delay: 0s;
}

.polar-tile:nth-child(3n + 2) {
  --rot: 2deg;
  animation-delay: 0.35s;
}

.polar-tile:nth-child(3n) {
  --rot: -1deg;
  animation-delay: 0.7s;
}

.polar-tile__link {
  display: block;
  position: absolute;
  inset: 0;
  text-decoration: none;
  color: inherit;
}

.polar-tile__bg {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--radius) - 2px);
  z-index: 0;
}

.polar-tile__bg--lime {
  background: var(--lime);
}

.polar-tile__bg--pink {
  background: var(--pink);
}

.polar-tile__bg--lav {
  background: var(--lavender);
}

.polar-tile__bg--sky {
  background: var(--sky);
}

.polar-tile__bg--cream {
  background: var(--cream);
}

.polar-tile__bg--terra {
  background: #e8a090;
}

.polar-frame {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 22%;
  bottom: 7%;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.15);
}

.polar-frame__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: visible;
  background: linear-gradient(180deg, #f0ebe3 0%, #e8e0d4 100%);
  margin: 8px 8px 0;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.polar-pop {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 118%;
  max-width: none;
  height: 135%;
  object-fit: cover;
  object-position: top center;
  z-index: 4;
  filter: drop-shadow(0 3px 0 var(--ink)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.polar-frame__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
  min-height: 42px;
  position: relative;
  z-index: 5;
  background: var(--white);
}

.polar-name {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  max-width: 72%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.polar-mini-logo {
  height: 18px;
  width: auto;
  flex-shrink: 0;
  opacity: 0.9;
}

.polar-tile:hover .polar-pop {
  transform: translateX(-50%) translateY(-4px) scale(1.03);
  transition: transform 0.3s var(--ease, ease);
}

.polar-tile:hover {
  animation-play-state: paused;
}

.catalog-toolbar {
  max-width: 520px;
  margin: 0 auto 32px;
}

.catalog-search {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--vol-layer-sm);
}

.catalog-search:focus {
  outline: none;
  box-shadow: var(--vol-layer);
}

.catalog-search::placeholder {
  color: rgba(12, 12, 12, 0.45);
}

.catalog-foot-note {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: var(--vol-layer-sm);
  font-weight: 700;
  font-size: 0.88rem;
}

.nav-sticker.is-active {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}
