.servicios {
    background-color: #2C3E50;
    position: relative;
    overflow: hidden;
}

/* Contenedor con ancho intermedio para esta sección */
.servicios .container {
    width: 93%;  /* Término medio entre el container general (90%) y el propuesto (95%) */
    max-width: 1200px;  /* Término medio entre el general (900px) y el más ancho (1400px) */
}

/* Grid de servicios - 4 en línea para pantallas grandes */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;  /* Término medio entre 2rem y 1.5rem */
    margin: 0rem auto 2rem;
    max-width: 1300px;  /* Término medio entre 1200px y 1400px */
}

/* Tarjetas de servicio */
.servicio-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem 1.75rem;  /* Término medio entre 2rem y 1.5rem */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.servicio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Actualizar el estilo del contenedor de iconos */
.servicio-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: rgba(181, 127, 80, 0.2); /* Color dorado semitransparente como en sobre-nos */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.servicio-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Actualizar el filtro para que coincida con el de sobre-nos */
    filter: brightness(0) saturate(100%) invert(70%) sepia(13%) saturate(1352%) hue-rotate(346deg) brightness(92%) contrast(87%);
}

/* Estilo específico para el segundo icono (Material incluido) */
.servicio-card:nth-child(2) .servicio-icon {
    padding: 12px;         /* Padding más pequeño específicamente para este icono */
}

.servicio-card h3 {
    color: #b57f50;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.servicio-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
}

/* Animaciones sutiles */
.servicio-card {
	animation: fadeInUp 0.8s ease-out forwards;
	opacity: 0;
}

.servicio-card:nth-child(1) { animation-delay: 0.1s; }
.servicio-card:nth-child(2) { animation-delay: 0.3s; }
.servicio-card:nth-child(3) { animation-delay: 0.5s; }
.servicio-card:nth-child(4) { animation-delay: 0.7s; }

/* Breakpoint para pantallas medianas - 2x2 grid */
@media (max-width: 1200px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Breakpoint para pantallas pequeñas - 1 columna (todas apiladas) */
@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .servicio-card {
        padding: 1.5rem;
    }
    
    .servicio-icon {
        width: 80px;        /* Tamaño para tablets */
        height: 80px;
        padding: 14px;
    }
    
    .servicio-card:nth-child(2) .servicio-icon {
        padding: 11px;      /* Mantener la proporción en el padding reducido */
    }
    
    .servicio-card h3 {
        font-size: 1.2rem;
    }
}

/* Hide slider controls by default (desktop view) */
.slider-controls {
  display: none;
}

/* --- Slider móvil: override grid -> track scrollable --- */
@media (max-width: 480px) {
  .servicios-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem 0;
    padding-left: 1rem; /* espacio para visualizar el 'peek' */
    
    /* Hide scrollbar while keeping functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  
  /* Hide scrollbar for Chrome, Safari and Opera */
  .servicios-grid::-webkit-scrollbar {
    display: none;
  }

  .servicio-card {
    min-width: 82%;
    flex: 0 0 82%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    scroll-margin: 1rem;
    padding: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1;
    animation: none !important; /* Disable animation on mobile */
  }

  /* CONTROLES */
  .slider-controls {
    display: flex;  /* Override to show on mobile */
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0 0.5rem;
  }

  .slider-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    color: white;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform .12s ease, background .12s;
  }
  .slider-btn:active { transform: scale(.96); }
  .slider-btn:focus { outline: 2px solid rgba(181,127,80,0.6); outline-offset: 2px; }

  .slider-dots {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin: 0 0.6rem;
  }

  .slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    border: none;
    padding: 0;
    transition: all .22s ease;
    cursor: pointer;
  }
  .slider-dot[aria-pressed="true"] {
    width: 28px;
    border-radius: 14px;
    background: #b57f50; /* color destacado */
    height: 8px;
  }

  /* Accesibilidad: si hay muchas cards, que no ocupe demasiado */
  .servicios {
    padding-bottom: 3rem;
  } /* Aumentado de 1.25rem a 3rem */
}
