/* Header */
.menu-item.active::after {
  opacity: 1;
  width: 120%;
}

.menu-item.active {
  font-weight: bold;
}

/* New car banner */
.newcar-banner {
  position: relative;
  width: 100%;
  height: 240px;
  background-image: url('/public/images/newcars/banner-0km.webp');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  height: 0;
  padding-top: calc((363 / 1884) * 100%);
}

/* Brands section */
.brands-section {
  text-align: center;
  background-color: #ffffff;
  padding: 2rem 4rem;
}

.brands-title {
  font-family: 'Rubik One', sans-serif;
  font-weight: 500;
  font-size: 25px;
  color: #0F0F0F;
  text-transform: uppercase;
}

.brands-subtitle {
  font-family: 'Open Sans Regular', sans-serif;
  color: #0F0F0F;
  padding-top: 1rem;
}

.brands-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.brand-card {
  position: relative;
  display: inline-block;
  width: 23rem;
  border-radius: 10px;
  overflow: hidden;
  background-color: white;
}

.brand-card img {
  display: block;
  width: 100%;
  height: 10rem;
  border: 1px solid #0F0F0F;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.brand-button {
  position: absolute;
  top: 75%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid #0F0F0F;
  border-radius: 5px;
  padding: 10px 20px;
  font-family: 'Rubik One', sans-serif;
  font-weight: 500;
  cursor: pointer;
  background: none;
  color: #0F0F0F;
}

.brand-button:hover {
  background-color: #0F0F0F;
  color: #ffffff;
}

/* Filters section */
.filters-section {
  background-color: #ffffff;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 2rem 0rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Rubik One', sans-serif;
  font-size: 25px;
  font-weight: 500;
  color: #0F0F0F;
  text-transform: uppercase;
  padding-left: 2rem;
}

.search-container {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
  padding: 0rem 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: #CECECE;
  color: #A4A4A4;
  border-radius: 5px;
  padding: 10px;
  width: 47rem;
}

.header-search-icon, .header-search {
  display: none;
}

.search-box input {
  border: none;
  background: transparent;
  flex: 1;
  font-family: 'Open Sans Regular', sans-serif;
  font-size: 16px;
  outline: none;
  color: #424242;
}

.search-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.select-wrapper.open::after {
  transform: translateY(-30%) rotate(-135deg);
}

.order-select {
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  width: 23rem;
  height: 3.5rem;
  color: #424242;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.order-select:focus {
  outline: none;
  color: #424242;
}

/* Para eliminar la flecha en IE */
.order-select::-ms-expand {
  display: none;
}

/* Cars Section */
.cars-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.section-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
}

/* Cars Grid */
.cars-section {
  display: flex;
  justify-content: center;
}

.cars-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  max-width: 900px; /* Ajusta este valor según el ancho que deseas */
  width: 100%;
}

/* Car Card */
.car-card {
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.car-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Car Image */
.image-container {
  position: relative;
}

.image-container img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Car Info */
.car-info {
  padding: 15px;
  text-align: center;
}

.car-info h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* Car Button */
.car-card-button {
  display: block;
  width: 100%;
  padding: 10px;
  background-color: #0F0F0F;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.car-card-button:hover {
  background-color: #444;
}


@media (max-width: 768px) {

  .newcar-banner {
    position: relative;
    width: 100%;
    background-image: url('/public/images/newcars/banner-autos-0KM_mobile.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    height: 91vw;
  }

  .header-search-icon {
    display: block;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }

  #headerSearchBtn {
    background-color: transparent;
    padding: 8px 0px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }

  .header-search {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    display: none;
    background: #000000;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 999;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }

  .header-search.active {
    display: flex;
  }

  .header-search input {
    width: 85%;
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex-grow: 1;
  }

  .header-search button {
    font-size: 16px;
    background-color: transparent;
    color: #fff;
    border: none;
    border-radius: 4px;
  }

  .search-icon {
    filter: brightness(0) invert(1);
    width: 24px;
    height: 24px;
    transition: filter 0.3s ease;
  }

  /* Brands section */
  .brands-section {
    display: none;
  }

  /* Filters section  */
  .filters-container {
    display: none;
  }

  /* Filters section */
  .filters-section {
    background-color: #ffffff;
    padding: 0.5rem 0px;
    text-align: left;
    margin-top: 1.5rem;
  }

  .section-title {
    font-family: 'Rubik One', sans-serif;
    font-size: 25px;
    font-weight: 500;
    color: #0F0F0F;
    text-transform: uppercase;
    padding: 0rem 1.5rem;
  }

  .search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0px;
    width: 100%;
    padding: 0rem 1.5rem;

  }

  .search-box {
    display: none;
  }

  .search-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
  }

  .select-wrapper {
    position: relative;
  }

  .select-wrapper::after {
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease;
    right: 5px;
    content: "";
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
  }

  .select-wrapper.open::after {
    transform: translateY(-50%) rotate(45deg);
  }

  .order-select {
    padding: 0px;
    border: 0px;
    font-size: 16px;
    cursor: pointer;
    height: 3.5rem;
    color: #424242;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 8rem;
  }

  .order-select:focus {
    outline: none;
    color: #424242;
  }

  /* Filter-cars section */
  .filter-toggle-btn {
    border: none;
    margin-right: 0px;
    background-color: transparent;
    padding: 0px;
    font-size: 16px;
    cursor: pointer;
    width: 5rem;
    height: 3.5rem;
    color: #424242;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .filters-container.active {
    display: block;
  }

  /* Cars section */
  .cars-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .cars-container {
    flex-grow: 1;
    display: flex;
    gap: 10px;
    flex-direction: column;
    flex-wrap: wrap;
  }

  .car-card {
    width: 100%;
    display: none;
  }

  .car-card:nth-child(-n+4) {
    display: block;
  }

  #showMoreBtn {
    height: 3.5rem;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #0F0F0F;
    border-radius: 5px;
    font-family: 'Rubik One', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    background: none;
    color: #0F0F0F;
    display: block;
  }

  #showMoreBtn:hover {
    background-color: #0F0F0F;
    color: #ffffff;
  }

  .car-info {
    position: relative;
    overflow: hidden;
  }

  .info-overlay {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease;
    z-index: 10;
  }

  .info-overlay.active {
    left: 0;
  }

  .info-overlay-content {
    display: flex;
    gap: 1px;
    padding: 10px;
    width: 100%;
    margin: 0 8px;
  }

  .details-btn {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1rem;
    margin: 5px;
    cursor: pointer;
    font-weight: 600;
    height: 3.5rem;
    font-family: Rubik One;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    text-align: center;
    text-transform: uppercase;
  }

  .close-btn {
    flex: 0.2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #FF8585;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-weight: 600;
    height: 3.5rem;
    margin: 5px;
  }

  .close-btn img {
    filter: invert(0);
  }

  .search-icon-desk {
    display: none;
  }
}