/* ============================================================
   GALLERY — Popy Floppy
   Filter bar, product grid, product cards
   ============================================================ */

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-section {
  padding: 0.9rem var(--gap);
  border-bottom: 1px solid var(--border);
  background-color: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 90;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--logo-green);
  padding: 0 0.3rem;
  white-space: nowrap;
}

.filter-divider {
  width: 1px;
  height: 1.4rem;
  background: var(--border);
  margin: 0 0.6rem;
  flex-shrink: 0;
}

.filter-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.filter-btn.active[data-group="style"] {
  background-color: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.filter-btn.active[data-group="type"] {
  background-color: var(--green);
  border-color: var(--green);
  color: #fff;
}

.filter-btn.active[data-filter="all"] {
  background-color: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* Count of visible products */
.results-count {
  margin: 1rem auto 0;
  max-width: 1400px;
  padding: 0 var(--gap);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .product-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */

.product-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--purple);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.product-card.hidden {
  display: none;
}

.card-link {
  display: block;
}

/* Thumbnail wrapper — maintains aspect ratio even before image loads */
.card-img-wrap {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: var(--surface-2);
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ease);
}

.product-card:hover .card-img-wrap img {
  transform: scale(1.05);
}

/* Placeholder shown when image has not yet been added */
.card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.15;
  pointer-events: none;
}

/* Cards with no real image yet — show emoji more prominently */
.card-img-wrap.placeholder .card-img-placeholder {
  opacity: 0.6;
  font-size: 3.5rem;
}

/* Style pill badge */
.card-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(0,0,0,0.65);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Card body */
.card-body {
  padding: 0.9rem 1rem;
}

.card-body h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-meta .dot {
  color: var(--orange);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.no-results {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.no-results.visible {
  display: block;
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.no-results small {
  font-size: 0.85rem;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem var(--gap);
  flex-wrap: wrap;
}

.pagination:empty {
  display: none;
}

.page-btn {
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.page-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.page-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-btn.ellipsis {
  border-color: transparent;
  background: none;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   TICKER BAR
   ============================================================ */

.ticker-bar {
  width: 100%;
  height: 36px;
  background-color: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 0;
  animation: ticker-left 35s linear infinite;
}

@keyframes ticker-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   CAR TICKER
   ============================================================ */

.ticker-bar--car {
  height: 44px;
  position: relative;
  overflow: hidden;
  clip-path: inset(0);
}

/* Dashed centre road line */
.ticker-bar--car::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    to right,
    transparent        0px,
    transparent        12px,
    rgba(255,220,80,0.35) 12px,
    rgba(255,220,80,0.35) 36px,
    transparent        36px,
    transparent        48px
  );
}

/* Bottom car — travels right→left, offset by half a lap so always opposite the top car */
.car-rig {
  position: absolute;
  bottom: 0;
  animation: car-drive 10s linear infinite;
  animation-delay: -5s;
}

@keyframes car-drive {
  from { transform: translateX(105vw); }
  to   { transform: translateX(-280px); }
}

/* Top car — mirrored, travels left→right, enters simultaneously with bottom car */
.car-rig--top {
  animation: car-drive-top 10s linear infinite;
}

.car-rig--top .car-svg {
  transform: scaleX(-1);
}

@keyframes car-drive-top {
  from { transform: translateX(-280px); }
  to   { transform: translateX(105vw); }
}

.car-svg {
  display: block;
  width: 200px;
  height: 44px;
  flex-shrink: 0;
}

.ticker-item {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 1rem;
}

.ticker-star {
  color: var(--logo-green);
  margin-right: 0.4rem;
}

.ticker-sep {
  color: var(--border);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ============================================================
   HERO SLIDER
   ============================================================ */

.hero-slider {
  position: relative;
  width: 100%;
  height: 440px;
  overflow: hidden;
  background-color: var(--surface);
}

.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Slide-specific backgrounds */
.hero-slide--1 {
  background-image: url('../images/hero/1.png');
}
.hero-slide--2 {
  background-image: url('../images/hero/2.png');
}
.hero-slide--3 {
  background-image: url('../images/hero/3.png');
}

/* Dark gradient left-to-right so text is always readable */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.45) 55%,
    rgba(0,0,0,0.10) 100%
  );
}

/* Text content */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  padding: 0 4rem;
  max-width: 580px;
  opacity: 0;
}

.hero-slide.active .hero-content {
  animation: hero-text-in 0.7s 0.35s ease forwards;
}

@keyframes hero-text-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--logo-green);
  margin-bottom: 0.55rem;
}

.hero-title {
  font-family: 'LuckiestGuy', system-ui, sans-serif;
  font-size: 2.8rem;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.8rem;
  text-shadow: 2px 3px 14px rgba(0,0,0,0.65);
}

.hero-sub {
  font-size: 1rem;
  color: rgba(234,234,240,0.82);
  max-width: 400px;
  margin-bottom: 1.6rem;
  line-height: 1.55;
}

.hero-cta {
  display: inline-block;
  background-color: var(--purple);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}

.hero-cta:hover {
  background-color: var(--logo-purple);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(223,69,255,0.35);
}

/* Prev / Next arrows */
.hero-prev,
.hero-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.8rem;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.38);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  backdrop-filter: blur(4px);
}

.hero-prev { left: 1.2rem; }
.hero-next { right: 1.2rem; }

.hero-prev svg,
.hero-next svg {
  width: 1.1rem;
  height: 1.1rem;
}

.hero-prev:hover,
.hero-next:hover {
  background: rgba(192,112,212,0.55);
  color: #fff;
  border-color: var(--purple);
}

/* Dot indicators */
.hero-dots {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.55rem;
  z-index: 10;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--ease), transform var(--ease);
}

.hero-dot.active {
  background: var(--logo-purple);
  transform: scale(1.35);
}

.hero-dot:hover:not(.active) {
  background: rgba(255,255,255,0.6);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .hero-slider {
    height: 300px;
  }

  .hero-content {
    padding: 0 1.5rem;
    max-width: 100%;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 0.88rem;
    margin-bottom: 1.1rem;
  }

  .hero-prev,
  .hero-next {
    display: none;
  }
}

@media (max-width: 600px) {
  .filter-group {
    gap: 0.4rem;
  }

  .card-body h2 {
    font-size: 0.9rem;
  }
}
