/* =========================================
   CARRUSEL DE SERVICIOS (JS-driven)
   Reglas escritas a mano porque este layout
   se inyecta vía JavaScript, y las clases de
   Tailwind usadas solo dentro de servicios.js
   no se compilan en el stylesheet del proyecto.
   ========================================= */

.svc-category {
    margin-bottom: 2.5rem;
}
.svc-category:last-child {
    margin-bottom: 0;
}

.svc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* "Ver todo" — versión desktop (al lado del título) */
.svc-see-all-desktop {
    display: none;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .svc-see-all-desktop {
        display: inline-flex;
    }
}

/* "Ver todo" — versión móvil (debajo del carrusel) */
.svc-see-all-mobile {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}
.svc-see-all-mobile a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}
@media (min-width: 640px) {
    .svc-see-all-mobile {
        display: none;
    }
}

/* Contenedor del carrusel (track + flechas) */
.svc-carousel {
    position: relative;
    padding: 0 4px;
}

/* Riel scrolleable con snap */
.svc-carousel-track {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
.svc-carousel-track::-webkit-scrollbar {
    display: none;
}

/* Cada tarjeta ocupa un ancho fijo dentro del riel (nunca se desborda) */
.svc-card {
    scroll-snap-align: start;
    flex: 0 0 85%;
    max-width: 340px;
    box-sizing: border-box;
}
@media (min-width: 640px) {
    .svc-card {
        flex-basis: 47%;
        max-width: none;
    }
}
@media (min-width: 1024px) {
    .svc-card {
        flex-basis: 31.5%;
    }
}

/* Flechas prev/next */
.svc-carousel-btn {
    display: none; /* ocultas por defecto en móvil */
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: #fff;
    color: #8e0225;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.svc-carousel-btn:hover {
    background: #8e0225;
    color: #fff;
}
.svc-carousel-btn--prev { left: -6px; }
.svc-carousel-btn--next { right: -6px; }

@media (min-width: 768px) {
    .svc-carousel-btn {
        display: flex;
    }
    .svc-carousel-btn--prev { left: -20px; }
    .svc-carousel-btn--next { right: -20px; }
}

/* Oculta la flecha cuando no hace falta desplazar (JS decide esto) */
.svc-carousel-btn.is-hidden {
    display: none !important;
}

/* Estados: cargando / vacío / error, dentro del riel */
.svc-status {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    flex: 1 0 100%;
}

.svc-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(142, 2, 37, 0.15);
    border-top-color: #8e0225;
    animation: svc-spin 0.8s linear infinite;
}
@keyframes svc-spin {
    to { transform: rotate(360deg); }
}

.svc-retry-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: #8e0225;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}
.svc-retry-btn:hover {
    background: #650017;
}