/* Header */
.menu-item.active::after {
  opacity: 1;
  width: 120%;
}

.menu-item.active {
  font-weight: bold;
}

/* New car banner */
.used-banner {
  position: relative;
  width: 100%;
  /* background-image: url("/public/images/used/banner-autos-usados_mobile.webp"); */
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  height: 91vw;
}

/* Search in header */
.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;
}

.search-icon-desk {
  display: none;
}

/* Brands section - hidden on mobile */
.brands-section {
  display: none;
}

/* Filters section */
.filters-section {
  background-color: #ffffff;
  padding: 0.5rem 0px;
  margin-top: 1.5rem;
  text-align: left;
}

.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 {
  content: "";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.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 toggle button - visible on mobile */
.filter-toggle-btn {
  border: 2px solid #859fe7;
  background-color: #859fe7;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  min-width: 120px;
  height: 3.5rem;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(133, 159, 231, 0.3);
}

.filter-toggle-btn:hover {
  background-color: #6b8bd8;
  border-color: #6b8bd8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(133, 159, 231, 0.4);
}

.filter-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(133, 159, 231, 0.3);
}

/* Filters container */
.filters-container {
  display: none;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  padding-right: 0px;
}

.filters-container.active {
  display: block;
}

.filter-group {
  margin-bottom: 24px;
}

.filter-title {
  font-family: "Open Sans Regular", sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #0f0f0f;
  position: relative;
}

.toggle-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s;
  padding: 5px;
  margin-right: 3rem;
  display: none; /* Ocultar el botÃ³n toggle */
}

.filter-group.active .toggle-btn {
  transform: translateY(-50%) rotate(90deg);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-left: 10px;
  transition: 0.3s;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.filter-option.hidden {
  display: none;
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.filter-options .see-more {
  display: none;
  font-size: 14px;
  color: #007bff;
  cursor: pointer;
  text-decoration: underline;
}

.filter-options.has-more .see-more {
  display: inline-block;
}

.filter-options.expanded .filter-option.hidden {
  display: flex;
}

.ver-mas {
  color: #3483fa;
  text-decoration: none;
  font-size: 14px;
}

/* Botones para remover filtros - Start */
.delete-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 1rem 1.5rem 0 1.5rem;
}

.filter-buttons {
  display: inline-flex;
  align-items: center;
  background-color: #fff;
  padding: 0 5px 0 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}

.filter-button-name {
  color: #666;
  margin: 5px;
  font-size: 13px;
}

.delete-button-filter {
  background-color: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
}
/* Botones para remover filtros - End */

/* Cars section */
.cars-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.cars-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.car-card {
  width: 100%;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: none;
}

.car-card {
  display: block;
}

.car-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.car-detail-link {
  text-decoration: none;
  color: #000;
}

.image-container {
  position: relative;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.image-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.price-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: #fff;
  padding: 5px 10px;
  font-family: "Open Sans Regular", sans-serif;
  font-size: 30px;
  border-radius: 4px;
  z-index: 1;
}

.car-info {
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.car-info-car {
  padding: 1rem 0.3rem;
  position: relative;
  overflow: hidden;
}

.car-info h3 {
  margin: 0 0 0.5rem;
  padding-left: 0.3rem;
  font-family: "Open Sans Regular", sans-serif;
  font-size: 24px;
}

.car-info p {
  margin: 0;
  padding-left: 0.3rem;
  color: #666;
  font-family: "Open Sans Regular", sans-serif;
  font-size: 16px;
}

/* Info overlay */
.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);
}

/* Show more button */
#showMoreBtn {
  height: 3.5rem;
  background-color: transparent;
  border: 1px solid #0f0f0f;
  border-radius: 5px;
  font-family: "Rubik One", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  color: #0f0f0f;
  display: block;
}

#showMoreBtn:hover {
  background-color: #0f0f0f;
  color: #ffffff;
}

/* Why buy at LIV */

.why-buy {
  padding-top: 40px;
  padding-bottom: 120px;
}

.why-buy-title {
  padding: 0 20px;
  font-family: "Rubik One", sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  width: 80%;
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 2rem;
  color: #0f0f0f;
}

.why-buy-description {
  padding: 0 20px;
  font-family: "Open Sans Regular", sans-serif;
  margin-bottom: 20px;
  color: #0f0f0f;
}

.why-buy-card-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.why-buy-card {
  flex: 0 0 auto;
  width: 90%;
  scroll-snap-align: center;
  padding: 50px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  align-items: center;
  text-align: center;
  background-color: #f4f5ff;
  box-shadow: 0 4px 4px #00000040;
}

.why-buy-card-icon {
  width: 44px;
  margin-bottom: 15px;
}

.why-buy-card-title,
.why-buy-card-description {
  font-family: "Open Sans Regular", sans-serif;
}

.why-buy-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #232562;
}

.why-buy-card-description {
  line-height: 1.6rem;
}

.why-buy-card-bold {
  font-weight: 800;
  font-family: "Open Sans Regular", sans-serif;
}

/* Desktop styles - applied with media queries */
@media (min-width: 768px) {
  /* New car banner */
  .used-banner {
    background-image: url("/public/images/used/banner-autos-usados_desktop.webp");
    background-size: cover;
    height: 0;
    padding-top: calc((366 / 1884) * 100%);
  }

  /* Header search */
  .header-search-icon {
    display: none;
  }

  .search-icon-desk {
    display: block;
    width: 24px;
    height: 24px;
    transition: filter 0.3s ease;
  }

  /* Brands section */
  .brands-section {
    display: block;
    text-align: center;
    background-color: #ffffff;
    padding: 2rem 4rem;
  }

  .brands-titles-container {
    margin-bottom: 2rem;
  }

  .brands-title {
    font-size: 25px;
  }

  .brands-subtitle {
    padding-top: 1rem;
  }

  .brands-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
  }

  .brand-card {
    width: 23rem;
    border-radius: 10px;
  }

  .brand-card img {
    height: 10rem;
  }

  .brand-button {
    top: 75%;
  }

  /* Filters section */
  .filters-section {
    padding: 2rem 0rem;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .delete-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0rem 4rem;
  }

  .search-container {
    display: flex;
    width: 100%;
    margin-top: 20px;
    justify-content: center;
    gap: 15px;
  }

  .search-box {
    display: flex;
    align-items: center;
    background: #CECECE;
    color: #A4A4A4;
    border-radius: 5px;
    padding: 10px;
    width: 47rem;
    height: 56px;
  }

  .search-box input {
    border: none;
    background: transparent;
    flex: 1;
    font-family: 'Open Sans Regular', sans-serif;
    font-size: 16px;
    outline: none;
    color: #424242;
  }

  .filter-toggle-btn {
    display: none;
  }
  
  /* Estilos espec¨ªficos para el ¨ªcono de filtros */
  .filter-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
  }
  
  /* Animaci¨®n del ¨ªcono cuando se activa */
  .filter-toggle-btn.active .filter-icon {
    transform: rotate(180deg);
  }

  .order-select {
    width: 23rem;
    border: 1px solid #ccc;
    padding: 10px;
  }

  .select-wrapper::after {
    right: 16px;
  }

  /* Cars section */
  .cars-section {
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
  }

  .filters-container {
    display: block;
    width: 220px;
    flex-shrink: 0;
  }

  .cars-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    flex-direction: initial;
  }

  .car-card {
    display: block;
    width: auto;
  }

  .info-overlay {
    display: none;
  }

  #showMoreBtn {
    display: none;
  }

  /* Why buy at LIV */

  .why-buy {
    width: 90%;
    max-width: 1400px;
    text-align: center;
    margin: 0 auto;
  }

  .why-buy-title {
    width: 100%;
  }

  .why-buy-description {
    padding: 0 40px;
    font-family: "Open Sans Regular", sans-serif;
    margin-bottom: 40px;
    color: #0f0f0f;
  }

  .why-buy-card-list {
    scroll-snap-type: unset;
    -webkit-overflow-scrolling: unset;
    gap: 20px;
  }

  .why-buy-card {
    width: 400px;
    flex: unset;
    width: unset;
    border: 2px solid #859fe7;
    box-shadow: none;
  }

  .why-buy-card-icon {
    width: 60px;
  }
}

/* Branch Pagination Styles */
.branch-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  padding: 0 1rem;
}

.pagination-container {
  display: flex;
  gap: 0.5rem;
  background: #f5f5f5;
  padding: 0.5rem;
  border-radius: 8px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: 'Open Sans Regular', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.pagination-btn.active {
  background: #859fe7;
  color: white;
  font-weight: 600;
}

@media (max-width: 767px) {
  .branch-pagination {
    margin: 1.5rem 0;
  }
  
  .pagination-container {
    gap: 0.25rem;
    padding: 0.25rem;
  }
  
  .pagination-btn {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  /* Estilos mejorados para el bot¨®n de filtros en mobile */
  .filter-toggle-btn {
    font-size: 14px;
    padding: 10px 20px;
    min-width: 100px;
    height: 44px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }
  
  .filter-icon {
    width: 16px;
    height: 16px;
  }
  
  /* Mejorar el contenedor de b¨²squeda en mobile */
  .search-container {
    padding: 1rem 1.5rem 0 1.5rem;
    gap: 10px;
  }
}