* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --card-bg: #ffffff;
  --soft-bg: #f3f5f9;
  --text-main: #1e293b;
  --text-soft: #6b7280;
  --accent-1: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #c084fc;
  --accent-4: #6366f1;
  --radius: 16px;
}

/* Loader Overlay */
#pageLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.98) 100%);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#pageLoader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Loader Content */
.loading-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-text {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.7);
  animation: bounce 1s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }

  40% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

/* Default sidebar (desktop visible) */
.filterBtn {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-4));
}

.filter-toggle-btn {
  display: none !important;
}

aside {
  transition: transform 0.3s ease;
}

.card-header {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-4));
}

/* Base card look */
.listing-card {
  background:
    linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
    linear-gradient(135deg, rgba(56, 189, 248, .45), rgba(129, 140, 248, .45), rgba(192, 132, 252, .45)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .08);
}

.listing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

/* Image area */
.card-img-wrap {
  position: relative;
  background: var(--soft-bg);
}

.card-img-top {
  width: 100%;
  height: 115% !important;
  aspect-ratio: 16/9;
  object-fit: cover;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .15));
  background: radial-gradient(120% 60% at 50% 0%, #fff 0%, var(--soft-bg) 100%);
}

/* Corner badge (sticker vibe) */
.corner-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow: 0 6px 14px rgba(129, 140, 248, .35);
  text-transform: uppercase;
  letter-spacing: 1px;
  transform: rotate(-5deg);
  animation: badgePop 0.5s ease-out;
}

/* Body */
.listing-body {
  background: #f8fafc;
  padding: 18px 18px 20px;
}

.listing-title {
  margin: 0 0 8px 0;
  padding-top: 20px !important;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: .3px;
}

.listing-text {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

/* Specs → cute pill chips */
.specs {
  list-style: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #475569;
  background: #eef2ff;
  border: 1px solid #e6e9ff;
  padding: 6px 10px;
  border-radius: 9999px;
}

/* CTA row (price + button) */
.cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  font-size: 1.35rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Gradient outline button */
.btn-cta {
  position: relative;
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3)) border-box;
  color: #0f172a;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(129, 140, 248, .25);
}

/* Tablet layout: stack title → text → specs → price → button (770px–1400px) */
@media (min-width: 770px) and (max-width: 1400px) {
  .listing-body {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-cta {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .price {
    font-size: 1.5rem;
    text-align: center;
  }
}

/* Mobile: comfortable stacking and sizing (<770px) */
@media (max-width: 769px) {
  aside {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: 80% !important;
    max-width: 320px;
    background: #fff;
    z-index: 1050;
    overflow-y: auto;
    transform: translateX(-100%);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.2);
  }

  aside.active {
    transform: translateX(0);
  }

  /* Floating Filter Button */
  .filter-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #38bdf8, #818cf8, #6366f1);
    color: #fff !important;
    font-size: 18px !important;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    animation: badgePop 0.5s ease-out;
  }

  .listing-title {
    font-size: 1.05rem;
  }

  .listing-text {
    font-size: 14px;
  }

  .price {
    font-size: 1.35rem;
    text-align: center;
  }

  .btn-cta {
    width: 100%;
    justify-content: center;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}

@media (max-width: 575.98px) {
  .card-header {
    margin-top: 10px;
  }
}

/* Fade-in animation for newly loaded cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInAnim 0.5s ease-in;
}

@keyframes fadeInAnim {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}