/* Global container overflow fixes to prevent persona head clipping */
.labcron,
.labcron .container {
    overflow: visible !important;
}

.h_top_info {
    display: none;
}

.img_top {
    height: auto !important;
}

/* Section Title with increased separation */
.alfa-title {
    color: #002B9D;
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 60px;
    font-family: inherit;
    line-height: 1.2;
}

.alfa-title b,
.alfa-title strong {
    font-weight: 800;
}

/* Carousel Outer Container */
.alfa-carousel-container {
    position: relative;
    width: 100%;
    overflow: visible;
}

/* Alfa Cards Grid */
.alfa-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    overflow: visible;
}

/* Card Base Structure */
.alfa-card {
    position: relative;
    width: 100%;
    height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    cursor: pointer;
    text-decoration: none !important;
    box-sizing: border-box;
}

/* Background image box clipped with rounded corners */
.alfa-card-bg-box {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 10px 25px rgba(0, 43, 157, 0.18);
}

.alfa-card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

/* Person image anchored at bottom, transform-origin bottom center prevents growing downwards */
.alfa-card-persona {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0) scale(1);
    transform-origin: bottom center;
    height: 440px;
    max-width: none;
    width: auto;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Blue gradient overlay - reduced height (bottom 45% only) */
.alfa-card-gradient {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    background: linear-gradient(0deg, #002B9D 0%, rgba(0, 43, 157, 0.85) 40%, rgba(0, 43, 157, 0) 100%);
    z-index: 3;
    pointer-events: none;
}

/* Card Body Overlay with 30px 25px padding */
.alfa-card-body {
    position: relative;
    z-index: 4;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    box-sizing: border-box;
}

/* Logo container for crossfade paint transition */
.alfa-card-logo-container {
    margin-bottom: 14px;
    display: flex;
    justify-content: flex-start;
    position: relative;
    height: 75px;
    width: auto;
}

.alfa-card-logo {
    height: 75px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.45s ease-in-out, transform 0.45s ease-in-out;
}

.alfa-logo-base {
    position: relative;
    opacity: 1;
    z-index: 1;
}

.alfa-logo-active {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 2;
}

/* Bottom footer: text + button */
.alfa-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.alfa-card-text {
    flex: 0 0 68%;
    width: 68%;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    margin: 0;
    padding: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.alfa-card-btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.22);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    padding: 7px 14px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Hover effects */
.alfa-card:hover .alfa-card-bg {
    filter: grayscale(0%);
}

.alfa-card:hover .alfa-card-persona {
    transform: translateX(-50%) translateY(-12px) scale(1.08);
}

.alfa-card:hover .alfa-card-btn {
    background: rgba(255, 255, 255, 0.38);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Logo "Pinta" Crossfade Animation on Hover */
.alfa-card:hover .alfa-logo-base {
    opacity: 0;
}

.alfa-card:hover .alfa-logo-active {
    opacity: 1;
}

/* Mobile Layout Customization (Single Card Slider) */
@media (max-width: 768px) {
    .alfa-carousel-container {
        overflow: hidden !important;
        width: 100% !important;
        padding-top: 65px !important;
        margin-top: -25px !important;
    }

    .alfa-cards-grid {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .alfa-cards-grid > .curso {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 4px !important;
        overflow: visible !important;
    }

    /* Mobile Text and Button ratio: 50% / 50% */
    .alfa-card-text {
        flex: 0 0 50% !important;
        width: 50% !important;
        padding-right: 6px;
    }

    .alfa-card-btn {
        flex: 0 0 50% !important;
        width: 50% !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        text-align: center;
    }
}

/* Custom Carousel Controls Styling */
.alfa-custom-controls {
    display: none !important;
}

@media (max-width: 768px) {
    .alfa-custom-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 16px !important;
        margin-top: 30px !important;
        width: 100% !important;
    }

    .alfa-ctrl-prev,
    .alfa-ctrl-next {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        outline: none !important;
        box-shadow: none !important;
        transition: transform 0.15s ease !important;
        -webkit-tap-highlight-color: transparent !important;
        user-select: none !important;
    }

    .alfa-ctrl-prev:active,
    .alfa-ctrl-next:active {
        transform: scale(0.88) !important;
    }

    .alfa-ctrl-img {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        object-fit: contain !important;
        display: block !important;
        pointer-events: none !important;
        user-select: none !important;
        border-radius: 50% !important;
    }

    .alfa-ctrl-pill {
        background: #e2e2e2 !important;
        background-color: #e2e2e2 !important;
        border-radius: 25px !important;
        padding: 8px 18px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        margin: 0 !important;
        box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
        min-width: 110px !important;
        height: 36px !important;
        box-sizing: border-box !important;
    }

    .alfa-ctrl-dot {
        width: 14px !important;
        height: 14px !important;
        min-width: 14px !important;
        min-height: 14px !important;
        max-width: 14px !important;
        max-height: 14px !important;
        border-radius: 50% !important;
        border: 2.5px solid #002B9D !important;
        background: transparent !important;
        background-color: transparent !important;
        cursor: pointer !important;
        display: inline-block !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        visibility: visible !important;
        opacity: 1 !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        outline: none !important;
        box-shadow: none !important;
        vertical-align: middle !important;
        transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .alfa-ctrl-dot.active {
        background: #002B9D !important;
        background-color: #002B9D !important;
        border-color: #002B9D !important;
        transform: scale(1.1) !important;
    }
}