html {
  color-scheme: light;
  background-color: #f2f3f4;
}

body {
 font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #111;
  background: #fff;
  margin: 0;
}
header {
  background: #fff;
  box-shadow: none;
  border-bottom: 1px solid #ddd;
  padding: 1rem 6%;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}
header h1 {
  font-weight: 700;
  font-size: 1.5rem;
  color: #111;
  margin: 0;
  letter-spacing: 2px;
}
/* ================== */
/* IMAGES */
/* ================== */
.fav-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
  .saved-row {
    width: 100%;
  }

.saved-btn {
  padding: 12px 16px;
  font-size: 16px;
  border: none;
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.back-btn {
  margin-bottom: 24px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.fav-btn:hover {
  transform: scale(1.1);
}
.main-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 14px;
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.03);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

.main-image.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #555;
  animation: fadeUp 0.4s ease forwards;
}

.empty-state h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 24px;
}

.empty-state button {
  padding: 12px 22px;
  border: none;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 16px;
}

.main-image:hover {
  transform: scale(1.05);
}

.main-image-box {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  flex:1;
}

/* ================== */
/* FILTERS (DESKTOP BASE) */
/* ================== */
.filters {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  position: sticky;
  top: 64px;
  height: fit-content;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  color: #000;

}

.filter-group {
  margin-bottom: 18px;
  
}

.filter-group.collapsed .filter-content {
  display: none;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: none;
  background: none;
  padding: 8px 0;
  width: 100%;
  font-weight: bold;
  color: #000;
}

.filter-content {
  margin-top: 8px;
  padding-left: 6px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  color: #000;
}

.checkbox input {
  width: 18px;
  height: 18px;
  background-color: #fff;
  border: 1px solid #ccc;
  -webkit-appearance: checkbox;
  accent-color: #000;
}

/* ================== */
/* LAYOUT */
/* ================== */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: auto 1fr;
  max-width: 1400px;
  margin: 0 auto;
  gap: 24px;
  padding: 24px;
  align-items: start;
}

.filters {
  grid-column: 1;
  grid-row: 2;
}

.content {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

/* ================== */
/* TOP FILTER BAR */
/* ================== */
.top-filters-bar {
  grid-column: 2;
  grid-row: 1;
  background: #fff;
  border-radius: 14px;
  padding: 34px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 24px;
z-index: 50;
   position: sticky;
  top: 64px;
}

/* Selected Filter Chips */
.selected-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#unselectAll {

  padding: 12px 18px;
  border-radius: 5px;
  border: none;
  background: #000;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
}

.filter-chip {
  background: #f2f3f4;
  border-radius: 5px;
  padding: 12px 24px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

.filter-chip button {
  background: none;
  border: none;
  margin-left: 8px;
  font-size: 16px;
  cursor: pointer;
}

/* ================== */
/* SORT + WRAPER */
/* ================== */
.wraper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  padding: 12px 16px;
  font-size: 16px;
  border: none;
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ================== */
/* CAR CARD */
/* ================== */
.car-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 32px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0px 15px rgb(200,200,200);
    margin-bottom:15px;
 display: grid;
  grid-template-columns: 55% 45%;
  grid-auto-rows: min-content; /* <-- this makes row fit the tallest content without extra space */
  gap: 32px;
  padding: 24px;
  margin-bottom: 15px;
  position: relative; /* needed for ::before */
}

.car-media {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  height: auto; /* important */
}
.car-media .thumbs img {
  height:100px; /* fixed height, instead of calc() */
}
.thumbs {
  display: flex;
  flex-direction: row;      /* stack vertically */
  gap: 10px;                   /* space between thumbnails */

}

.thumbs img {
  width: 100%;                 /* make each thumb fill container width */
  border-radius: 10px;
  object-fit: cover;
}

.car-info {
  display: flex;
  flex-direction: column;
}

.car-info .carName {
  font-size: 26px;
  margin-bottom: 8px;
}

.condition {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.specs,
.vin {
  font-size: 15px;
  color: #444;
  line-height: 1.5;
}

.price {
  font-size: 28px;
  font-weight: 600;
  margin: 20px 0;
}

.details-btn {
  width: fit-content;
  padding: 12px 18px;
  border-radius: 5px;
  border: none;
  background: #000;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

/* ================== */
/* MOBILE FILTER BUTTON */
/* ================== */
.mobile-filters-btn {
  display: none;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ================== */
/* OVERLAY */
/* ================== */
.filters-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.filter-group .filter-content {
    display: grid; /* make the checkboxes grid items */
    grid-template-columns: repeat(2, 1fr); /* 2 columns, adjust as needed */
    gap: 8px; /* space between checkboxes */
}

.filter-group .filter-content label {
    display: flex;
    align-items: center;
    gap: 5px; /* space between checkbox and text */
}
.filters-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
/* Skeleton loader animation */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}
.skeleton {
  background: #ddd;
  background-image: linear-gradient(90deg, #ddd 25%, #eee 50%, #ddd 75%);
  background-size: 400px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.5s infinite linear;
  border-radius: 16px;
}

/* Skeleton card container */
.skeleton-card {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 32px;
  padding: 24px;
  border-radius: 16px;
  background: #f5f5f5;
}

/* Left side skeletons (image + thumbs) */
.skeleton-card .left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton.main-image-skeleton {
  width: 100%;
  height: 220px;
  border-radius: 14px;
}

.skeleton.thumbs-skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.skeleton.thumb-skeleton {
  height: 60px;
  border-radius: 10px;
}

/* Right side skeletons (info text blocks) */
.skeleton-card .right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton.text-skeleton {
  height: 24px;
  width: 60%;
  border-radius: 8px;
}

.skeleton.text-skeleton.short {
  width: 30%;
}

.skeleton.text-skeleton.medium {
  width: 45%;
}

.skeleton.button-skeleton {
  height: 42px;
  width: 40%;
  border-radius: 8px;
  margin-top: auto;
}
.car-card {
  
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0px 15px rgb(200,200,200);
  margin-bottom:15px;
}

/* Animated geometric background */
.car-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(225,0,0,0.05), transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(0,225,255,0.05), transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(0,0,255,0.05), transparent 50%);
  background-size: 200% 200%;
  z-index: 0;
  animation: bgMove 20s linear infinite;
  pointer-events: none;
}
.car-card {
  transform: translateY(0);
  transition: transform 0.2s ease-out;
}

@keyframes bgMove {
  0% { background-position: 0% 0%, 100% 50%, 50% 100%; }
  50% { background-position: 100% 0%, 0% 50%, 50% 0%; }
  100% { background-position: 0% 0%, 100% 50%, 50% 100%; }
}

/* Make sure content is above the background */
.car-card > * {
  z-index: 1;
}

/* ================== */
/* MOBILE */
/* ================== */
@media (max-width: 768px) {
    .car-media {
    position: relative; /* positioning context for fav-btn */
  }
.car-cards-container{
  margin-bottom:15px;
}
  .fav-btn {
    position: absolute;
    top: 10px;       /* distance from top of main image */
    right: 10px;     /* distance from right edge */
    width: 42px;     /* same as desktop */
    height: 42px;
    padding: 0;
    font-size: 20px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    background: rgba(255,255,255,0.9); /* keep existing style */
    color: #000;
  }
 #unselectAll {
  flex-shrink: 0;         /* don't shrink */
    width: 100%;
    max-width: 320px;
    padding: 12px 18px;
    border-radius: 5px;
    border: none;
    background: #000;
    color: #fff;
    font-size: 16px;       /* scales better on mobile */
    cursor: pointer;
    margin-top: auto;       /* push to bottom in flex container */
    align-self: center;
  }
    .filter-group,
  .filter-header,
  .checkbox {
    font-size: 16px; /* increase for mobile readability */
  }
  .skeleton-card {
    display: flex;             /* stack left + right vertically */
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  .content,
  .car-cards-container {
    width: 100%;
    max-width: 100%;
    margin-bottom:15px;
  }
 .skeleton.main-image-skeleton {
    height: 180px;
  }

  .skeleton.thumb-skeleton {
    height: 50px;
  }
  .car-card,
  .skeleton-card {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column; /* stack left + right vertically */
    gap: 16px;
    padding: 16px;
    margin: 0 auto; /* center cards */
    margin-bottom:15px;
  }

  .skeleton-card .left,
  .skeleton-card .right {
    width: 100%;
  }
  .skeleton-card .left,
  .skeleton-card .right {
    width: 100%;
  }
  .saved-btn {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: -100px;
    z-index:500
  }
  .checkbox input {
    width: 20px;
    height: 20px;
  }
  .layout {
    grid-template-columns: 1fr;
        width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 12px;
    gap: 16px;
  }
 .filter-content {
    flex: 1; /* take all space above button */
    overflow-y: auto;
  }
  /* ===== MOBILE FILTER PANEL ===== */
  .filters {
      position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    overflow-y: auto;
    transition: left 0.3s ease;
    border-radius: 0 14px 14px 0;
    padding: 20px 20px 80px 20px; /* extra bottom padding so content doesn't overlap button */
  
    flex-direction: column;

     display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns */
    gap: 10px; 
  }

  .filters.show {
    left: 0;
  }
.car-media .thumbs {
  overflow-x: auto;         /* allow horizontal scroll */
  gap: 10px;
  flex-wrap: nowrap;        /* don’t wrap to next line */
  width: 100%;
  padding-bottom: 4px;      /* small spacing under thumbs */
}

.car-media .thumbs img {
  flex: 0 0 auto;           /* prevent shrinking */
  width: 80px;              /* fixed width, scales well */
  height: 60px;             /* fixed height */
  object-fit: cover;
  border-radius: 10px;
}
.car-media .thumbs::-webkit-scrollbar {
  height: 6px;
}
.car-media .thumbs::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}
  /* 🔥 CONTROLS OVERLAY ON TOP OF BAR */
  .wraper {
    position: absolute;
    top: -55px;
    left: 0;
    width: 100%;
    display: flex;
    gap: 8px;
    margin-top:-10px;
  }

  /* SORT = BIGGER */
  .sort-wrapper {
    flex: 1;
     flex-direction: column; /* stack on mobile */
    align-items: stretch;
  }

  .sort-select {
    width: 100%;
        padding: 12px;
    font-size: 16px;
    
  -webkit-appearance: none; /* remove default iOS styles */
  -moz-appearance: none;
  appearance: none;
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  position: relative;

  }

  /* FILTER BUTTON = SMALLER */
  .mobile-filters-btn {
    display: inline-block;
    flex: 1;
    width: 100%;
    margin: 0;
  }

  /* Push bar down so overlay fits */
  .top-filters-bar {
    margin-top: 72px;
     display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 30px 16px;
  }

  .car-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .car-info {
    align-items: center;
    text-align: center;
  }

  .details-btn {
    width: 100%;
    max-width: 320px;
  }
   .layout {
    display: flex !important; /* remove grid */
   
  
    
  
  }
    #unselectAll {
    display: block;             /* make sure it's block */
    grid-column: 1 / -1;        /* span all columns of the parent grid */
    width: 100%;                /* take full width */
    max-width: 100%;            /* no limit */
    padding: 16px 20px;         /* mobile-friendly padding */
    border-radius: 8px;
    text-align: center;
    background: #000;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin: 20px 0 0 0;         /* spacing above */
  }
}

