.servicios-bar {
  background: var(--azul-marino);
  padding: 1rem 0.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(18, 38, 94, 0.15);
  margin: 2rem 0 3rem 0;
  overflow-x: auto;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.page-content {
  padding: 140px 0 50px 0;
  background-color: var(--white);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.servicios-bar::-webkit-scrollbar {
  display: none;
}

.servicios-bar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.servicios-bar li {
  margin: 0;
}

.servicios-bar a {
  color: #f5f6fa;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: block;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.servicios-bar a:hover {
  color: var(--white);
  background: var(--vinotinto);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  border-radius: 20px;
}

.main-servicios-content {
  margin: 0 auto;
  padding: 1rem 2rem 1rem 2rem;
  width: 90%;
  max-width: 1200px;
}

.servicio-section {
  background: var(--white);
  margin-bottom: 3.5rem;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(18, 38, 94, 0.06);
  scroll-margin-top: 100px;
}

.servicio-section h2 {
  color: var(--azul-marino);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.servicio-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 3px;
  background-color: var(--vinotinto);
}

.servicio-content {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
}

.servicio-image {
  flex: 0 0 35%;
}

.servicio-image img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.servicio-section:hover .servicio-image img {
  transform: scale(1.02);
}

.servicio-text {
  flex: 1;
}

.servicio-text p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #333;
}

.servicio-text ul {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.servicio-text li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

html {
  scroll-behavior: smooth;
}

.servicio-text h3 {
  font-size: 1.5rem;
  color: var(--azul-marino);
  margin: 2rem 0 1.2rem;
  position: relative;
  display: inline-block;
}

.servicio-text h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60%;
  height: 2px;
  background-color: var(--vinotinto);
}

.tipos-marca-titulo {
  font-size: 1.5rem;
  color: var(--azul-marino);
  margin: 2.5rem 0 1.2rem;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.tipos-marca-titulo::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: var(--vinotinto);
}

.tipos-marca-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.tipo-marca-card {
  background: #f8f9fd;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 3px 8px rgba(18, 38, 94, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

.tipo-marca-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(18, 38, 94, 0.12);
}

.tipo-marca-image {
  height: 160px;
  overflow: hidden;
  position: relative;
}

.tipo-marca-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tipo-marca-card:hover .tipo-marca-image img {
  transform: scale(1.05);
}

.tipo-marca-card h4 {
  color: var(--azul-marino);
  font-size: 1.1rem;
  padding: 0.8rem 0.8rem 0.4rem;
  margin: 0;
}

.tipo-marca-card p {
  padding: 0 0.8rem 1rem;
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
  flex-grow: 1;
}

.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background-color: var(--white);
  color: var(--azul-marino);
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.arrow-up {
  font-size: 24px;
  font-weight: bold;
}

.services-section .container {
  margin: 1.2rem auto 0 auto;
  width: 90%;
  max-width: 1200px;
}

@media (max-width: 900px) {
  .servicios-bar {
    padding: 0.8rem 0.5rem;
    margin: 1.5rem auto;
    overflow-x: auto;
    width: 90%;
    max-width: 800px;
    -webkit-overflow-scrolling: touch;
  }

  .servicios-bar ul {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 1rem;
    width: max-content;
    min-width: max-content;
    margin: 0 auto;
  }

  .servicios-bar::before,
  .servicios-bar::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    pointer-events: none;
    z-index: 2;
  }

  .servicios-bar::before {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(18, 38, 94, 0.8),
      rgba(18, 38, 94, 0)
    );
  }

  .servicios-bar::after {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(18, 38, 94, 0.8),
      rgba(18, 38, 94, 0)
    );
  }

  .servicio-content {
    flex-direction: column;
  }

  .servicio-image {
    flex: 0 0 100%;
    margin-bottom: 1.5rem;
  }

  .servicio-section {
    padding: 1.5rem;
    scroll-margin-top: 80px;
  }

  .servicio-section h2 {
    font-size: 1.5rem;
  }

  .main-servicios-content {
    padding: 1rem 0.5rem;
    width: 95%;
  }

  .page-content {
    padding: 120px 0 50px 0;
  }
}

@media (max-width: 768px) {
  .tipos-marca-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 600px) {
  .servicios-bar a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .servicio-section {
    padding: 1.2rem;
    scroll-margin-top: 70px;
  }

  .page-content {
    padding: 100px 0 50px 0;
  }
}

@media (max-width: 576px) {
  .tipos-marca-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .tipo-marca-image {
    height: 140px;
  }

  .tipos-marca-titulo {
    margin-top: 2rem;
    font-size: 1.4rem;
  }

  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}
