* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Oswald', sans-serif;
}

body {
  background-color: black;
}

/* ========== Category Scroll Section ========== */
.car-types {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 10vw;
}

.category-container {
    overflow-x: auto;
    width: 100%;
}

.categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.categories::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.category {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 120px;
  height: 120px;
  padding: 10px;
  background-color: #dbdbdb;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.category:hover {
  transform: scale(1.05);
  background-color: #444;
}

.category img {
  height: 70px;
  width: auto;
  border-radius: 16px;
}

.category-item {
  display: inline-block;
  color: #000;
  text-decoration: none;
  font-size: 16px;
}

.category-item:hover {
  color: lightskyblue;
}

/* Scroll buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.car-types:hover .scroll-btn,
.latest-news:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn.left {
    left: 0;
}

.scroll-btn.right {
    right: 0;
}
/* ========== Latest News Section ========== */
.latest-news {
  width: 80vw;
  margin: 0 10vw;
  padding-top: 20px;
}

/* Remove all text decoration from links in cards */
.latest-news a,
.latest-news a:hover,
.latest-news a:visited,
.latest-news a:link,
.latest-news a:active {
  text-decoration: none !important;
  color: inherit;
}

.latest-news h1 {
  text-align: left;
  color: white;
  font-size: 50px;
}

.latest-news h2 {
  padding-top: 5px;
  text-align: left;
  color: white;
  font-size: 40px;
}

.latest-news hr {
  width: 20%;
  height: 10px;
  margin-top: -1px;
  margin-left: 0;
  background-color: lightskyblue;
  border: 1px solid lightskyblue;
}

.latest-news .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px;
  margin: 25px auto;
  width: 100%;
}

.latest-news .card a {
  text-decoration: none !important;
  color: white;
  border: none;
  outline: none;
}

.latest-news .card a:hover,
.latest-news .card a:visited,
.latest-news .card a:link,
.latest-news .card a:active {
  text-decoration: none !important;
  color: white;
}

.latest-news .card a h3 {
  font-size: 16px;
  margin-top: 10px;
  text-decoration: none !important;
}

.latest-news .card a p {
  font-size: 14px;
  color: lightskyblue;
  text-decoration: none !important;
}

.latest-news .card:hover h3 {
  color: lightskyblue;
}

.latest-news .image-section {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px;
}

.latest-news .image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
    border-radius: 16px;
}.latest-news .name {
  color: white;
  font-weight: bold;
  font-size: 25px;
  padding-left: 10px;
}

.latest-news .price {
  padding-top: 10px;
  color: white;
  font-size: 18px;
  padding-left: 10px;
}

.latest-news .card:hover img {
  filter: grayscale(50%);
  border-radius: 16px;
}

.latest-news .card hr {
  height: 2px;
  margin-top: 7px;
  color: rgb(128, 206, 255);
  width: 40px;
}

/* ========== "See Full List" Button ========== */
.latest-news .full-button {
  font-size: 18px;
  background-color: transparent;
  padding: 10px 25px;
  color: white;
  border: 1px solid white;
  border-radius: 12px;
  cursor: pointer;
  display: inline-block;
  margin: 20px 0 0 0;
  text-align: center;
  text-decoration: none;
  width: fit-content;
}

.latest-news .full-button:hover {
  background-color: lightskyblue;
  color: black;
}

.latest-news .full-button a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

/* ========== General Typography Fixes ========== */
.latest-news p {
  color: lightskyblue;
  font-size: 30px;
  padding-top: 5px;
}

.latest-news h3 {
  color: white;
  font-size: 22px;
  padding-top: 5px;
  transition: filter 0.3s ease;
}

/* ========== Section Divider ========== */
hr {
  width: 80%;
  margin: 2vh auto;
  background-color: lightskyblue;
  border: 1px solid lightskyblue;
  height: 2px;
}

.mid-hr hr {
  width: 100%;
  color: #065586;
}

/* ========== Mobile Styles ========== */
@media (max-width: 768px) {
    .car-types {
        width: 100vw;
        margin: 0;
        padding: 15px 0 10px 0;
    }

    /* Hide scroll buttons on mobile */
    .scroll-btn {
        display: none;
    }

    /* Update category container for grid layout */
    .category-container {
        width: 90vw;
        padding: 0 5vw;
        overflow: hidden;
    }
    
    .categories {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* 3 columns */
        grid-template-rows: repeat(3, 1fr) !important;    /* 3 rows */
        gap: 10px !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: unset !important;
        flex-direction: unset !important;
    }
    
    .category {
        width: auto; /* Let grid control the width */
        height: 40px; /* Smaller height for mobile grid */
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide images in category cards on mobile */
    .category img {
        display: none;
    }
    
    .category-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
    
    .category-item span {
        font-size: 12px; /* Smaller text for mobile */
        text-align: center;
        color: #000000;
    }

    /* ========== Mobile Card Limits ========== */
    /* Limit cards to 3 per section while maintaining side margins */
    .latest-news {
        width: 80vw; /* Keep same side margins as desktop */
        margin: 0 10vw; /* Keep same side margins as desktop */
    }

    .latest-news .cards {
        display: grid;
        grid-template-columns: 1fr; /* Single column layout for mobile */
        gap: 20px;
        margin: 25px auto;
        width: 100%;
    }

    /* Limit video cards to 3 */
    .latest-news .cards .card:nth-child(n+4):not(.full-button) {
        display: none;
    }

    /* Limit review cards to 3 */
    #reviews-electric .card:nth-child(n+4) {
        display: none;
    }

    /* Limit news cards to 3 */
    #ev-news-cards .card:nth-child(n+4) {
        display: none;
    }

    /* Adjust typography for mobile */
    .latest-news h1 {
        font-size: 36px;
    }

    .latest-news h2 {
        font-size: 28px;
    }

    .latest-news p {
        font-size: 24px;
    }

    .latest-news h3 {
        font-size: 18px;
    }

    /* Responsive image container heights */
    .latest-news .image-section {
        height: 180px;
    }
}