/* Base variables and responsive breakpoints */
:root {
  --mobile: 480px;
  --tablet: 768px;
  --desktop: 992px;
  --large-desktop: 1200px;
}

/* Hero section - Mobile first approach */
.hero-rutas {
  height: 60vh;
  background-image: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: scroll; /* Fixed can cause issues on mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -4.375rem;
}

@media (min-width: 768px) {
  .hero-rutas {
    height: 70vh;
    background-attachment: fixed;
  }
}

.hero-rutas::before {
  content: "";
  position: absolute;
  inset: 0; /* Shorthand for top, right, bottom, left */
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.7));
  z-index: 1;
}

.hero-rutas .hero-content {
  text-align: center;
  z-index: 2;
  width: 100%;
  max-width: 50rem;
  padding: 0 1.25rem;
}

.hero-rutas .welcome-message {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeInUp 1s ease forwards;
  text-shadow: 0.125rem 0.125rem 0.25rem rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
  .hero-rutas .welcome-message {
    font-size: 4rem;
  }
}

.hero-rutas .welcome-subtitle {
  font-size: 1.125rem;
  margin: 0 auto 1.5rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeInUp 1s ease 0.5s forwards;
  text-shadow: 0.0625rem 0.0625rem 0.1875rem rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
  .hero-rutas .welcome-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeInUp 1s ease 1s forwards;
}

@media (min-width: 480px) {
  .hero-buttons {
    flex-direction: row;
    gap: 1.25rem;
  }
}

.hero-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 3.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  transition: all 0.3s ease;
  box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.2);
}

.hero-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.hero-btn.secondary {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(0.625rem);
  color: white;
  border: 0.125rem solid white;
}

.hero-btn:hover {
  transform: translateY(-0.1875rem);
  box-shadow: 0 0.5rem 1.5625rem rgba(0,0,0,0.3);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
}

.mouse {
  width: 1.875rem;
  height: 3.125rem;
  border: 0.125rem solid white;
  border-radius: 1.25rem;
  margin: 0 auto 0.625rem;
  position: relative;
}

.wheel {
  width: 0.375rem;
  height: 0.375rem;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 0.625rem;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.5s infinite;
}

.arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3125rem;
}

.arrow span {
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-bottom: 0.125rem solid white;
  border-right: 0.125rem solid white;
  transform: rotate(45deg);
  animation: arrowDown 1.5s infinite;
}

.arrow span:nth-child(2) {
  animation-delay: 0.2s;
}

.arrow span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes scrollWheel {
  0% {
    opacity: 1;
    top: 0.625rem;
  }
  100% {
    opacity: 0;
    top: 1.875rem;
  }
}

@keyframes arrowDown {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(-0.3125rem, -0.3125rem);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(0.3125rem, 0.3125rem);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Services wrapper */
.services-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

@media (min-width: 768px) {
  .services-wrapper {
    gap: 2rem;
    padding: 2rem 0;
  }
}

/* Search and filter section */
.search-filter-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--color-card);
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .search-filter-section {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
  }
}

.search-container {
  display: flex;
  width: 100%;
}

@media (min-width: 768px) {
  .search-container {
    flex: 1;
    min-width: 15.625rem;
  }
}

#search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 0.0625rem solid var(--color-border);
  border-right: none;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  font-size: 1rem;
}

#search-button {
  padding: 0.75rem 1rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#search-button:hover {
  background-color: var(--color-dark);
}

.filter-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 768px) {
  .filter-container {
    flex-direction: row;
    width: auto;
  }
}

.filter-container select {
  padding: 0.75rem 1rem;
  border: 0.0625rem solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
}

/* Category buttons */
.category-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .category-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .category-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .category-buttons {
    grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr));
  }
}

.category-btn {
  padding: 1rem;
  background-color: var(--color-card);
  border: 0.125rem solid var(--color-primary);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.category-btn i {
  font-size: 1.5rem;
}

.category-btn:hover,
.category-btn.active {
  background-color: var(--color-primary);
  color: white;
}

/* Services display */
.services-display {
  background-color: var(--color-card);
  padding: 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .services-display {
    padding: 2rem;
  }
}

#services-title {
  margin-bottom: 1.5rem;
  color: var(--color-primary);
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  #services-title {
    font-size: 1.8rem;
  }
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 480px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
    gap: 2rem;
  }
}

.service-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

.service-image {
  height: 12.5rem;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.service-content {
  padding: 1.5rem;
}

.service-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.service-description {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.service-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-icons a {
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-right: 0.5rem;
  transition: color 0.3s ease;
}

.contact-icons a:hover {
  color: var(--color-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-btn {
  padding: 0.5rem 1rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.page-btn:hover:not(:disabled) {
  background-color: var(--color-dark);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-number {
  padding: 0.5rem 1rem;
  background-color: var(--color-light);
  color: var(--color-primary);
  border: 0.0625rem solid var(--color-primary);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-number.active,
.page-number:hover {
  background-color: var(--color-primary);
  color: white;
}

/* Best of TenoCity section */
.best-of-tenocity {
  margin-bottom: 2rem;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 18.75rem;
  background-color: var(--color-card);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .carousel-container {
    height: 25rem;
  }
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-item {
  flex: 0 0 100%;
  height: 100%;
  padding: 1rem;
}

@media (min-width: 768px) {
  .carousel-item {
    padding: 1.5rem;
  }
}

.carousel-service {
  display: flex;
  flex-direction: column;
  background-color: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.1);
  height: 100%;
}

@media (min-width: 768px) {
  .carousel-service {
    flex-direction: row;
  }
}

.carousel-image {
  flex: 0 0 100%;
  height: 12.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .carousel-image {
    flex: 0 0 50%;
    height: auto;
  }
}

.carousel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.carousel-service:hover .carousel-image img {
  transform: scale(1.05);
}

.carousel-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .carousel-content {
    padding: 1.5rem;
  }
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .carousel-title {
    font-size: 1.8rem;
  }
}

.carousel-description {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .carousel-description {
    font-size: 1.1rem;
  }
}

.carousel-contact {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.carousel-contact a {
  color: var(--color-primary);
  font-size: 1.4rem;
  transition: color 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(46, 125, 50, 0.1);
}

.carousel-contact a:hover {
  color: var(--color-secondary);
  transform: translateY(-0.1875rem);
}

.carousel-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  transform: translateY(-50%);
}

.carousel-arrow {
  background-color: rgba(255, 255, 255, 0.8);
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.carousel-arrow:hover {
  background-color: var(--color-primary);
  color: white;
}

/* Topbar adjustments */
@media (max-width: 768px) {
  .topbar .container {
    flex-direction: column;
    gap: 0.625rem;
  }

  .weather-finance {
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
  }

  .finance-info {
    justify-content: center;
  }
}