/* Skip Navigation for Accessibility */
.skip-navigation {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-principal);
    color: #000;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
    font-weight: bold;
    border-radius: 0 0 4px 0;
}

.skip-navigation:focus {
    top: 0;
}

.logote {
    width: 300px;
}

.bloque-frase p {
    max-width: 400px;
}

.bloque-frase {
    margin-right: -2em;
}

/* Fluid typography for better responsive scaling */
.texto-banner-principal {
    font-size: clamp(2.1rem, 5vw + 1rem, 4.3rem);
    line-height: 1em;
    color: white;
    max-width: 22ch;
}

.paragraph {
    font-size: clamp(1rem, 1.5vw, 1.08rem);
    line-height: 1.6;
}

.bg-nucleo {
    position: relative;
    overflow: hidden;
    border: 0;
    transition: border 0.3s ease-in;
}

.bg-nucleo::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5) url(/assets/img/home.webp) no-repeat center center;
    background-size: cover;
    z-index: -1;
}

.bg-nucleo::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(105deg,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.75) 25%,
            rgba(0, 0, 0, 0) 45%,
            rgba(0, 0, 0, 0.75) 75%,
            rgba(0, 0, 0, 1) 100%);
    border-radius: var(--bs-border-radius-xxl) !important;
    z-index: 0;
    transition: backdrop-filter 0.3s ease-in-out;
}

.bg-nucleo * {
    z-index: 1;
}

#nosotros>div>div>div::after,
#portafolio>div>div>div::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: multiply;
    opacity: 0.85;
    z-index: -1;
    border-radius: var(--bs-border-radius-xxl) !important;
}

#portafolio div .bg-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    z-index: -1;
}

#proceso {
    min-height: 50vh;
}

.lista-proceso {
    counter-reset: item;
}

.lista-proceso>* {
    position: relative;
    padding-left: 5em;
}

@media (max-width: 767.98px) {
    .lista-proceso>* {
        padding-left: 1.5em;
    }

    .lista-proceso>*::before {
        font-size: 1.5em;
        padding: 0.2em 0.4em;
    }
}

.lista-proceso>*::before {
    content: counter(item) ". ";
    counter-increment: item;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: 2em;
    color: black;
    background-color: yellow;
    padding: 0.3em 0.5em;
}

.carousel-control-prev-icon {
    margin-right: 2em;
    color: var(--color-principal);
}

.carousel-control-next-icon {
    margin-left: 2em;
    color: var(--color-principal);
}

/* Botones personalizados de carrusel (proyectos y testimonios) */
.custom-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: none;
    background: none;
    transition: filter 0.2s;
}

.carousel-control-prev.custom-carousel-btn {
    left: -40px;
}

.carousel-control-next.custom-carousel-btn {
    right: -40px;
}

.custom-carousel-btn:hover .carousel-control-prev-icon,
.custom-carousel-btn:hover .carousel-control-next-icon {
    filter: brightness(1.2) drop-shadow(0 0 6px var(--color-principal, #0ff));
}

@media (max-width: 768px) {

    .carousel-control-prev.custom-carousel-btn {
        left: 0 !important;
        right: auto !important;
    }

    .carousel-control-next.custom-carousel-btn {
        right: 0 !important;
        left: auto !important;
    }
}

@media (min-width: 768px) {
    #testimoniosCarousel .carousel-item {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        opacity: 0;
        transition: opacity 0.6s ease;
        z-index: 0;
    }

    #testimoniosCarousel .carousel-item.active,
    #testimoniosCarousel .carousel-item-next.carousel-item-left,
    #testimoniosCarousel .carousel-item-prev.carousel-item-right {
        position: relative;
        opacity: 1;
        z-index: 1;
    }
}

@media (max-width: 767.98px) {
    .bg-nucleo {
        min-height: 85vh;
        padding: 1.5rem 0.5rem;
    }

    .bg-nucleo::after {
        background: linear-gradient(180deg,
                rgba(0, 0, 0, 0.4) 0%,
                rgba(0, 0, 0, 0) 70%,
                rgba(0, 0, 0, 0.4) 100%);
    }

    h1.texto-banner-principal {
        font-size: clamp(1.8rem, 5vw + 0.5rem, 2.5rem);
        line-height: 1.1em;
        text-align: center;
        margin-bottom: 1rem;
        max-width: none;
    }

    .bloque-frase {
        margin-right: 0 !important;
        font-size: 1em;
        padding: 0.5em;
        text-align: center;
    }

    .logote {
        width: 120px !important;
        margin: 0 auto 1.5em;
    }

    .d-flex.p-3,
    .d-flex.p-3.rounded-5.w-100.min-vh-95.pt-0.pt-md-5.px-md-5 {
        flex-direction: column !important;
        padding: 1em !important;
    }

    .d-flex.flex-wrap.gap-4,
    .d-flex.flex-wrap.align-items-center.justify-content-around.gap-3 {
        flex-direction: column !important;
        gap: 1em !important;
        align-items: stretch !important;
    }

    .btn,
    .btn-info,
    .btn-warning {
        width: 100%;
        margin-bottom: 1em;
        font-size: 1em;
        /* Ensure minimum touch target size of 44x44px */
        min-height: 44px;
        padding: 0.8em 1em;
    }

    /* Improve carousel controls for touch */
    .carousel-control-prev,
    .carousel-control-next {
        width: 44px;
        height: 44px;
    }

    .bg-proyecto {
        height: 180px;
        width: 100%;
    }

    .logo-proyecto {
        width: 90%;
        max-height: 100px;
        max-width: 145px;
        margin: 0 auto;
    }

    #testimonios .card {
        margin: 0 auto 1em !important;
        padding: 0 !important;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
        border-radius: 1em;
        height: auto !important;
        /* Allow card to grow */
        min-height: 350px;
        /* Increased from 315px */
    }

    #testimonios .card-body {
        padding: 1.5em 1em !important;
        /* Increased padding */
    }

    #testimonios .card-footer {
        padding: 1em 0.5em !important;
    }

    #testimonios .card-body img {
        margin: 0 0 1em 0 !important;
        width: 90px !important;
        height: 90px !important;
    }

    #testimonios .card-body p {
        font-size: 1em !important;
        text-align: center !important;
        max-width: 100% !important;
        margin-bottom: 1rem !important;
    }

    #testimonios .card-footer {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.8em !important;
        font-size: 0.95em !important;
        text-align: center !important;
    }

    #testimonios .card-footer div,
    #testimonios .card-footer a,
    #testimonios .card-footer span {
        width: 100% !important;
        text-align: center !important;
    }
}

#calltoaction {
    position: relative;
    padding: 6rem 0;
    background:
        /* Degradado diagonal más oscuro y menos brillante */
        linear-gradient(120deg, rgba(90, 0, 180, 0.13) 0%, rgba(40, 120, 30, 0.09) 100%),
        /* Líneas sutiles */
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 0px 2px);
    opacity: 0.97;
    overflow: hidden;
}

#calltoaction .container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

#calltoaction .cta-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    background: rgba(15, 12, 41, 0.6);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(57, 255, 20, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(57, 255, 20, 0.1);
    transition: all 0.3s ease;
}

#calltoaction .cta-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(57, 255, 20, 0.15);
    border-color: rgba(132, 0, 255, 0.4);
}

#calltoaction .cta-icon {
    font-size: 3.5rem;
    color: #39ff14;
    /* Verde radiactivo */
    margin-bottom: 1.5rem;
    text-shadow: 0 0 15px #39ff14, 0 0 30px rgba(57, 255, 20, 0.7);
    animation: pulse 2s infinite, neonGlow 1.5s ease-in-out infinite alternate;
}

#calltoaction .cta-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #39ff14, #84ff00, #00ff87);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
    position: relative;
    display: inline-block;
}

#calltoaction .cta-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #39ff14, #8400ff, transparent);
    border-radius: 3px;
}

#calltoaction .cta-text {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Botones del CTA */
#calltoaction .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

#calltoaction .cta-button {
    padding: 1rem 2.2rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#calltoaction .cta-button i {
    font-size: 1.2em;
}

#calltoaction .cta-button-primary {
    background: #39ff14;
    color: #000 !important;
    border: 2px solid #39ff14;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.7), 0 0 30px rgba(57, 255, 20, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#calltoaction .cta-button-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

#calltoaction .cta-button-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.9), 0 0 40px rgba(57, 255, 20, 0.5);
    background: #32e610;
    color: #000 !important;
}

#calltoaction .cta-button-primary:hover::before {
    left: 100%;
}

#calltoaction .cta-button:active {
    transform: translateY(1px);
}

#calltoaction .cta-button-secondary {
    background: rgba(132, 0, 255, 0.2);
    color: #fff !important;
    border: 2px solid #8400ff;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#calltoaction .cta-button-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

#calltoaction .cta-button-secondary:hover {
    background: rgba(132, 0, 255, 0.4);
    border-color: #a64dff;
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(132, 0, 255, 0.5);
}

#calltoaction .cta-button-secondary:hover::before {
    left: 100%;
}

/* Enlace de email */
#calltoaction .cta-email {
    color: #39ff14 !important;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

#calltoaction .cta-email::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-principal);
    transition: width 0.3s ease;
}

#calltoaction .cta-email:hover::after {
    width: 100%;
}

#calltoaction .text-white-80 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

/* Animación de brillo */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

@keyframes neonGlow {
    from {
        text-shadow: 0 0 5px #39ff14, 0 0 10px #39ff14, 0 0 15px #39ff14, 0 0 20px #39ff14;
    }

    to {
        text-shadow: 0 0 10px #39ff14, 0 0 20px #39ff14, 0 0 30px #39ff14, 0 0 40px #39ff14;
    }
}



/* Efecto de partículas */
#calltoaction::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 30%);
    pointer-events: none;
}

/* Efecto de borde resaltado */
#calltoaction .cta-content::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid rgba(57, 255, 20, 0.2);
    border-radius: 10px;
    pointer-events: none;
    z-index: -1;
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.1), 0 0 20px rgba(132, 0, 255, 0.1);
}

/* Responsive */
@media (max-width: 1200px) {
    #calltoaction .cta-title {
        font-size: 2.4rem;
    }

    #calltoaction .cta-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 992px) {
    #calltoaction {
        padding: 5rem 0;
    }

    #calltoaction .cta-content {
        padding: 3.5rem 2rem;
    }

    #calltoaction .cta-title {
        font-size: 2.2rem;
    }

    #calltoaction .cta-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    #calltoaction {
        padding: 4rem 0;
    }

    #calltoaction .cta-title {
        font-size: 1.8rem;
    }

    #calltoaction .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    #calltoaction .container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0;
    }

    #calltoaction .cta-button {
        width: 100%;
        justify-content: center;
    }

    #calltoaction .cta-text {
        font-size: 1.05rem;
    }
}

/* Estilos para las imágenes de los proyectos en el carrusel */
#portafolio .carousel-item .logo-proyecto {
    max-width: 90%;
    max-height: 145px;
    min-height: 100px;
    width: auto;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-position: center;
}

/* Contenedor de la imagen del proyecto */
#portafolio .bg-proyecto {
    position: relative;
    width: 100%;
    min-height: 300px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    background-blend-mode: multiply;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Estandarizar el contenedor del carrusel en home */
#portafolio .carousel-item>a>div>div {
    min-height: 350px;
    max-height: 400px;
    aspect-ratio: 16/9;
}

@media (max-width: 767.98px) {
    #portafolio .carousel-item>a>div>div {
        min-height: 320px;
        max-height: 360px;
    }
}


/* Contenedor del carrusel de proyectos */
#portafolio .carousel-inner {
    height: 100%;
}

#portafolio .carousel-item {
    height: 100%;
}

/* Ajustes responsivos */
@media (max-width: 767.98px) {
    #portafolio .bg-proyecto {
        min-height: auto !important;
        height: auto !important;
        padding: 20px 10px 40px 10px !important;
        /* Extra bottom padding for text */
        display: flex;
        flex-direction: column;
    }

    #portafolio .carousel-item .logo-proyecto {
        position: relative !important;
        /* Stop absolute positioning to let text flow */
        top: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 2rem auto 1rem auto !important;
        max-height: 85px;
        width: auto;
        max-width: 80%;
    }

    /* Override inline styles from PHP */
    #portafolio .carousel-inner,
    #portafolio .carousel-item,
    #portafolio .carousel-item>a>div {
        min-height: auto !important;
        height: auto !important;
    }

    /* Text adjustments */
    #portafolio h3 {
        font-size: 1.3rem !important;
        margin-top: 0.5rem;
    }

    #portafolio p {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
        /* Reduce from mb-5 */
        line-height: 1.4 !important;
    }
}

/* Ajustes para imágenes de testimonios */
#testimoniosCarousel .testimonial-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--color-principal);
    margin: 0 auto 1rem;
}

/* Ajustes responsivos */
@media (max-width: 767.98px) {
    #portafolio .bg-proyecto {
        height: 200px;
    }

    #portafolio .carousel-item img.logo-proyecto {
        margin-top: 2rem;
        max-height: 85px;
    }

    #testimoniosCarousel .testimonial-image {
        width: 100px;
        height: 100px;
    }
}

/* Fondo visual llamativo solo para la sección #portafolio */
#portafolio {
    position: relative;
    z-index: 1;
    background: #18151f;
    overflow: hidden;
}

#portafolio::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        /* Degradado diagonal más oscuro y menos brillante */
        linear-gradient(120deg, rgba(90, 0, 180, 0.13) 0%, rgba(40, 120, 30, 0.09) 100%),
        /* Líneas sutiles */
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 120px 40px);
    opacity: 0.97;
}

#portafolio>div {
    position: relative;
    z-index: 1;
}