/* ==========================================================================
   CAROUSEL STRUCTURE (Frontend Only)
   ========================================================================== */

:not(.editor-styles-wrapper) .ccl-numbered-service-slider {
    overflow: visible !important; /* Cambiado a visible para que la sombra no se corte */
    position: relative !important;
    padding: 20px 0 80px !important; /* Padding superior e inferior para sombras y controles */
    width: 100% !important;
    min-height: 450px;
    display: block !important;
}

:not(.editor-styles-wrapper) .swiper-wrapper {
    display: flex !important;
    flex-direction: row !important;
    transition-property: transform !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
}

:not(.editor-styles-wrapper) .swiper-slide {
    height: auto !important;
    display: flex !important;
    align-items: stretch !important;
    padding: 10px; /* Espacio para que la sombra respire */
}

/* Compact Card Adjustments */
.ccl-numbered-card-wrapper {
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0px 8px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Ocupar todo el slide */
}

.ccl-numbered-card-content {
    display: flex;
    padding: 0 40px 40px;
    gap: 40px;
    align-items: stretch;
    flex: 1;
}

/* Image Column - min 400px, fixed width on large screens */
.ccl-card-image-col {
    flex: 0 0 400px !important;
    max-width: 400px !important;
    min-width: 400px !important;
    display: flex;
}

.ccl-card-image-box {
    width: 100%;
    height: 100%;
}

.ccl-card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
    display: block;
}

/* Body Column - Right 75% */
.ccl-card-body-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card Header (Numbering) */
.ccl-card-number {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: right;
    padding: 20px 40px 0;
    letter-spacing: 1px;
}

/* Icon & Title Row */
.ccl-card-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ccl-card-icon-circle {
    width: 50px;
    height: 50px;
    background: #f8fafd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #eef2f6;
    overflow: hidden;
    padding: 10px;
    position: relative;
    text-align: center;
}

/* Evitar que el área de imagen crezca en el editor */
.editor-styles-wrapper .ccl-card-icon-circle .wp-block-image,
.editor-styles-wrapper .ccl-card-icon-circle .components-placeholder {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    inset: 0 !important;
}

.editor-styles-wrapper .ccl-card-icon-circle .components-placeholder__fieldset,
.editor-styles-wrapper .ccl-card-icon-circle .components-placeholder__label,
.editor-styles-wrapper .ccl-card-icon-circle .components-button {
    display: none !important;
}

/* Mostrar solo el icono de subida en pequeño */
.editor-styles-wrapper .ccl-card-icon-circle .components-placeholder::before {
    content: "⊕";
    font-size: 20px;
    color: var(--color-secondary);
}

.ccl-card-icon-circle img {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain !important;
}

.ccl-card-icon-circle svg,
.ccl-card-icon-circle i {
    width: 24px;
    height: 24px;
    color: var(--color-secondary) !important;
    fill: var(--color-secondary) !important;
}

.ccl-card-title-row h3 {
    margin: 0 !important;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary-light);
    line-height: 1.2;
}

/* Description & Items Alignment */
.ccl-card-description {
    margin-left: 65px;
}

.ccl-card-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-gray-dark);
    margin-bottom: 0px!important;
    text-align: justify;
}

.ccl-card-description b {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.ccl-card-divider {
    background-color: #BFC7D1 !important;
    border: 0 !important;
    height: 1px !important;
    margin-bottom: 1.5em !important;
    width: 100%!important;
}

.ccl-card-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-left: 30px;
}

.ccl-card-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 calc(50% - 10px);
    font-size: 14px;
    color: var(--color-gray-dark);
}

.ccl-card-item i {
    color: var(--color-warning);
    font-size: 12px;
    margin-top: 4px;
}

.ccl-card-item span {
    margin-top: 0 !important;
    line-height: 1.4;
}

/* Carousel Controls */
.ccl-service-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.ccl-service-pagination {
    position: relative !important;
    bottom: 0 !important;
    width: auto !important;
}

.ccl-service-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e0;
    opacity: 1;
}

.ccl-service-pagination .swiper-pagination-bullet-active {
    background: var(--color-accent);
    width: 25px;
    border-radius: 5px;
}

.ccl-service-prev,
.ccl-service-next {
    position: static !important;
    margin-top: 0 !important;
    color: var(--color-primary) !important;
    width: 40px !important;
    height: 40px !important;
    background: #f8fafd;
    border-radius: 50%;
    border: 1px solid #eef2f6;
    transition: var(--ccl-transition);
}

.ccl-service-prev:hover,
.ccl-service-next:hover {
    background: var(--color-primary);
    color: #fff !important;
}

.ccl-service-prev::after,
.ccl-service-next::after {
    font-size: 16px !important;
    font-weight: 900;
}

/* Custom Buttons - Full Width & Bottom Alignment */
.ccl-numbered-card-wrapper .wp-block-buttons {
    width: 100% !important;
    margin-top: auto !important; /* Empujar al fondo */
    padding-top: 30px;
    margin-left: 0 !important;
}

.ccl-numbered-card-wrapper .wp-block-button {
    width: 100% !important;
}

.ccl-numbered-card-wrapper .wp-block-button__link {
    background-color: #2D4B71 !important;
    color: #fff !important;
    font-family: "Poppins", sans-serif !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    padding: 14px 25px !important;
    width: 100% !important;
    display: block !important;
    text-align: center;
    font-size: 15px;
}

/* ==========================================================================
   EDITOR OVERRIDES (Vertical List)
   ========================================================================== */

.editor-styles-wrapper .swiper-wrapper {
    display: block !important;
}

.editor-styles-wrapper .ccl-service-controls {
    display: none !important;
}

.editor-styles-wrapper .ccl-numbered-card-wrapper {
    margin-bottom: 60px !important;
    border: 1px solid #eef2f6;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 991px) {
    .ccl-numbered-card-content {
        flex-direction: column;
        padding: 0 25px 30px;
        gap: 25px;
    }

    .ccl-card-image-col {
        width: 100%;
        max-width: 100%!important;
    }

    .ccl-card-description,
    .ccl-card-divider,
    .ccl-card-items-grid {
        margin-left: 0;
    }

    .ccl-card-item {
        flex: 0 0 100%;
    }
}



/* ==========================================================================
   SCROLL-STICKY MODE (≤ 5 slides)
   ========================================================================== */

:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper {
    position: sticky !important;
    top: 90px;
    min-height: calc(100vh - 110px); /* ocupa toda la pantalla → tapa la tarjeta de abajo */
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* z-index creciente: cada tarjeta tapa a la anterior al subir */
:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper:nth-child(1) { z-index: 1; }
:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper:nth-child(2) { z-index: 2; }
:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper:nth-child(3) { z-index: 3; }
:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper:nth-child(4) { z-index: 4; }
:not(.editor-styles-wrapper) .ccl-scroll-mode .ccl-numbered-card-wrapper:nth-child(5) { z-index: 5; }