/* =========================
   BLOQUE FOOTER
========================= */
.bf-footer-block {
    padding: 1rem;
    text-align: left;
    color: var(--wp--preset--color--foreground, #333);
}

.bf-footer-block h3 {
    font-size: 1.1rem;
    margin-bottom: 0.45rem;
    font-weight: 600;
}

.bf-footer-block .bf-body {
    font-size: 0.95rem;
    line-height: 1.6;
}

.bf-footer-block a {
    color: var(--wp--preset--color--accent, #0066cc);
    text-decoration: none;
}

/* =========================
   CARRUSEL DE SERVICIOS
========================= */

/* Contenedor general */
.bf-service-carousel-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: hidden;
    padding: 0 30px; /* espacio para flechas */
}

/* Carrusel (frontend) */
.bf-service-carousel,
.bf-service-track {
    display: flex;
    flex-direction: row;
    gap: 40px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 10px 60px 10px 60px;
}

/* Scrollbar */
.bf-service-carousel::-webkit-scrollbar,
.bf-service-track::-webkit-scrollbar {
    height: 8px;
}
.bf-service-carousel::-webkit-scrollbar-thumb,
.bf-service-track::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Ocultar scrollbar en todas las plataformas */
.bf-service-carousel .bf-service-track,
.bf-service-track {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge antiguo */
}
.bf-service-carousel .bf-service-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge nuevo */
}

/* Tarjetas (frontend) */
.bf-service-track .wp-block-group {
    flex: 0 0 calc((100% / 3) - 13.33px);
    scroll-snap-align: start;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.bf-service-track .wp-block-group:hover {
    transform: translateY(-6px);
}

.bf-service-track img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.bf-service-track .wp-block-group__inner-container {
    padding: 20px;
}

/* Flechas del carrusel */
.bf-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bf-carousel-btn:hover {
    background: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}

.bf-carousel-btn.prev { left: -10px; }
.bf-carousel-btn.next { right: -10px; }


/* =========================
   CARRUSEL EDITOR
========================= */

/* Contenedor editor */
.bf-service-carousel-editor {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-x: auto;
    padding: 10px;
}

.bf-service-carousel-editor > .wp-block,
.bf-service-carousel-editor > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block {
    flex: 0 0 30%;
    min-width: 250px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

/* Nivel superior horizontal */
.bf-service-carousel-editor > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
}

/* Tarjetas internas verticales */
.bf-service-carousel-editor .wp-block-group .block-editor-inner-blocks,
.bf-service-carousel-editor .wp-block-group .block-editor-block-list__layout {
    display: block !important;
    flex-direction: column !important;
}

/* Botón agregar + */
.bf-service-carousel-editor .block-list-appender,
.bf-add-card-button {
    flex: 0 0 auto;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 60px;
    width: 60px;
    height: 200px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.bf-service-carousel-editor .block-list-appender:hover,
.bf-add-card-button:hover {
    border-color: #888;
    opacity: 1;
}

/* =========================
   📱 Ajustes globales para carruseles en móvil
   (válido para todos los bf-service-carousel del sitio)
========================= */
@media (max-width: 600px) {

    /* --- Footer --- */
    .bf-footer-block {
        padding: 0.75rem;
    }
    .bf-footer-block h3 {
        font-size: 1rem;
    }

    /* --- Contenedores padres (elimina márgenes y padding) --- */
    .wp-block-uagb-container.alignfull,
    .wp-block-group,
    .wp-block-columns,
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    /* --- Carrusel principal --- */
    .bf-service-carousel-wrapper {
        width: 100vw !important;                /* ocupa todo el ancho del viewport */
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important; /* centra en pantalla completa */
        padding: 0 !important;
        overflow-x: hidden;
    }

    /* --- Carrusel interior --- */
    .bf-service-carousel,
    .bf-service-track {
        gap: 12px;              /* menos espacio entre tarjetas */
        padding: 0 10px;        /* bordes laterales suaves */
        scroll-padding: 0 10px;
    }

    /* --- Tarjetas individuales --- */
    .bf-service-track .wp-block-group {
        flex: 0 0 95%;          /* casi todo el ancho de la pantalla */
        max-width: 100%;
        min-width: auto;
        margin: 0 auto;
    }

    .bf-service-track img {
        height: 160px;
        object-fit: cover;
        width: 100%;
    }

    /* --- Flechas del carrusel --- */
    .bf-carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 1.5rem;
        top: 45%;
    }

    .bf-carousel-btn.prev { left: 5px; }
    .bf-carousel-btn.next { right: 5px; }
}
