/* ==========================================================================
   VARIABLES
   ========================================================================== */
:root {
    --primary: #fbb034;
    --secondary: #25D366;
    --dark: #111;
}

/* ==========================================================================
   BASE / RESET
   ========================================================================== */
html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f8f9fa;
    color: #222;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 160px;
}

main {
    flex: 1 0 auto;
}

/* ==========================================================================
   TIPOGRAFÍA
   ========================================================================== */
h1,
h2,
h3,
h4 {
    font-weight: 800;
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .45)),
        url('imagenes/fondo.jpg') center/cover no-repeat;
    color: #fff;
    display: flex;
    align-items: center;
    padding-top: 140px;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-cta {
    background: var(--primary);
    color: #111;
    font-size: 1.4rem;
    padding: 1.1rem 3rem;
    border: none;
    transition: .4s;
}

.btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(251, 176, 52, .45);
}

/* ==========================================================================
   TARJETAS
   ========================================================================== */
.card-project,
.testimonial-card {
    border: none;
    border-radius: 22px;
    overflow: hidden;
    transition: .4s;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .15);
}

.card-project:hover,
.testimonial-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .22);
}

.card-project {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-project .card-body {
    display: flex;
    flex-direction: column;
}

.card-project ul {
    flex-grow: 1;
}

.card-project .btn {
    align-self: flex-start;
}

.testimonial-card {
    background: #fff;
    padding: 2rem;
    position: relative;
}

.quote-icon {
    font-size: 3.5rem;
    color: var(--primary);
    opacity: .12;
    position: absolute;
    top: 10px;
    left: 20px;
}

/* ==========================================================================
   WHATSAPP FLOTANTE
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 120px;
    right: 25px;
    z-index: 999;
    width: 70px;
    height: 70px;
    background: var(--secondary);
    color: #fff;
    border-radius: 50%;
    font-size: 2.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    transition: .3s;
}

.whatsapp-float:hover {
    transform: scale(1.15);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: var(--dark);
    color: #ddd;
    flex-shrink: 0;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar-transparent {
    background: transparent;
    padding: .6rem 0;
    transition: .4s ease;
}

.navbar-scrolled {
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.logo-navbar {
    max-height: 180px;
    width: auto;
    object-fit: contain;
    transition: .4s;
}

.navbar-scrolled .logo-navbar {
    max-height: 55px;
}

/* ==========================================================================
   WHY CARDS
   ========================================================================== */
.why-card {
    transition: .35s;
    border: 1px solid rgba(251, 176, 52, .15);
    border-radius: 16px;
    background: #fff;
}

.why-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(251, 176, 52, .18);
}

/* ==========================================================================
   CARRUSEL DE PROYECTOS (tarjetas)
   ========================================================================== */
.project-carousel img {
    height: 240px;
    object-fit: cover;
    cursor: pointer;
}

.project-carousel video {
    height: 240px;
    object-fit: contain;
    background: #000;
}

/* ==========================================================================
   FLECHAS GENERALES
   ========================================================================== */
.carousel-control-prev,
.carousel-control-next {
    width: 12%;
    z-index: 20;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, .4);
    border-radius: 50%;
    padding: 12px;
}

/* ==========================================================================
   MODAL GALERÍA – Imágenes y videos
   ========================================================================== */
#imageModal {
    --modal-padding: 1rem;
}

#imageModal .modal-dialog {
    margin: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
}

#imageModal .modal-content {
    background: #000;
    border: 0;
    height: 100%;
    border-radius: 0;
}

#imageModal .modal-body {
    padding: 0;
    height: 100%;
    position: relative;
}

#modalCarousel {
    height: 100%;
    width: 100%;
}

#modalCarousel .carousel-inner,
#modalCarousel .carousel-item {
    height: 100%;
    width: 100%;
}

#modalCarousel .media-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--modal-padding);
}

#modalCarousel .modal-media {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #000;
    display: block;
    cursor: pointer;
}

/* Botón play/pausa overlay (se oculta al reproducir) */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.4s ease, transform 0.3s ease;
    z-index: 10;
    pointer-events: auto;
}

.play-overlay:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Ocultar cuando está reproduciendo */
.play-overlay.playing {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

/* Flechas del modal */
#imageModal .carousel-control-prev,
#imageModal .carousel-control-next {
    width: 12%;
    opacity: 0.8;
    transition: opacity 0.25s;
}

#imageModal .carousel-control-prev:hover,
#imageModal .carousel-control-next:hover {
    opacity: 1;
}

#imageModal .carousel-control-prev-icon,
#imageModal .carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.6);
    background-size: 60%;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 200px;
    }

    .logo-navbar {
        max-height: 65px;
    }

    .hero {
        min-height: 85vh;
        padding-top: 120px;
    }

    .whatsapp-float {
        bottom: 110px;
        right: 20px;
        width: 65px;
        height: 65px;
        font-size: 2.1rem;
    }

    #imageModal .carousel-control-prev,
    #imageModal .carousel-control-next {
        width: 20%;
    }

    .play-overlay {
        width: 80px;
        height: 80px;
        font-size: 2.8rem;
    }
}

/* ==========================================================================
   VIDEO EN CARRUSEL DE TARJETAS – OCUPA TODO EL ESPACIO COMO LAS IMÁGENES
   ========================================================================== */
.project-carousel .carousel-item {
    height: 240px;
    /* altura fija del contenedor para consistencia */
    overflow: hidden;
    background: #000;
}

.project-carousel img,
.project-carousel .video-wrapper {
    width: 100%;
    height: 100%;
}

.project-carousel .video-wrapper {
    position: relative;
}

.project-carousel .video-project {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* llena todo el espacio */
    object-position: center;
    /* centra el contenido */
    display: block;
}

/* Botón play centrado y bonito */
.play-btn-project {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 5;
}

.play-btn-project:hover {
    background: rgba(251, 176, 52, 0.85);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Ocultar al reproducir */
.video-wrapper.playing .play-btn-project {
    opacity: 0;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .project-carousel .carousel-item {
        height: 240px;
        /* o 200px si quieres más pequeño en móvil */
    }

    .play-btn-project {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
}
/* Ocultar flechas del modal en móvil (pantallas < 768px) */
@media (max-width: 767.98px) {
    #imageModal .carousel-control-prev,
    #imageModal .carousel-control-next {
        display: none !important;
    }
}

/* En desktop: hacerlas más discretas y elegantes */
@media (min-width: 768px) {
    #imageModal .carousel-control-prev,
    #imageModal .carousel-control-next {
        width: 8%;                  /* más angostas */
        opacity: 0.4;               /* semi-transparentes por defecto */
        transition: opacity 0.3s ease;
    }

    #imageModal .carousel-control-prev:hover,
    #imageModal .carousel-control-next:hover {
        opacity: 0.9;
    }

    #imageModal .carousel-control-prev-icon,
    #imageModal .carousel-control-next-icon {
        width: 3.5rem;
        height: 3.5rem;
        background-color: rgba(0,0,0,0.5);
        border-radius: 50%;
        background-size: 50%;       /* ícono más pequeño dentro del círculo */
    }
}
/* ==========================================================
   CENTRAR ÚLTIMA CARD CUANDO HAY NÚMERO IMPAR
   ========================================================== */

/* Desktop (3 columnas) */
@media (min-width: 992px) {
    .project-center-last {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Tablet (2 columnas) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .project-center-last {
        margin-left: auto;
        margin-right: auto;
    }
}
