/********** Template CSS **********/

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    font-weight: 600;
    transition: .5s;
    border-radius: 50px;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: inherit;
}

.btn-primary {
    color: var(--bs-white);
}


/*** Navbar ***/
.navbar {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 9;
    transition: .5s;
}

.navbar .navbar-nav .nav-link {
    margin-right: 25px;
    padding: 40px 0;
    color: var(--bs-white);
    font-size: 17px;
    text-transform: uppercase;
    outline: none;
    transition: .5s;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary);
}

@media (max-width: 991.98px) {

    .navbar .navbar-nav .nav-link,
    .navbar.bg-dark .navbar-nav .nav-link {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar .navbar-nav {
        margin-top: 8px;
        border-top: 1px solid var(--bs-light);
    }
}

@media (min-width: 992px) {
    .navbar.bg-dark .navbar-nav .nav-link {
        padding: 20px 0;
    }

    .navbar .nav-item .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}


/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: 100px;
    background: rgba(0, 0, 0, .7);
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
    width: 10%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 550px;
    }

    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    padding-top: 200px;
    background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7)), url(../img/carousel-1.jpg) top center no-repeat;
    background-size: cover;
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: var(--bs-white);
}


/*** Title ***/
.title {
    margin-bottom: 2rem;
}

.title .title-left,
.title .title-center,
.title .title-right {
    display: inline-block;
    text-transform: uppercase;
    overflow: hidden;
}

.title .title-center {
    text-align: center;
}

.title .title-right {
    text-align: right;
}

.title .title-left h5,
.title .title-center h5,
.title .title-right h5 {
    position: relative;
    display: inline-block;
    font-size: 18px;
    font-weight: 300;
}

.title .title-left h5::after,
.title .title-center h5::before,
.title .title-center h5::after,
.title .title-right h5::before {
    position: absolute;
    content: "";
    width: 500%;
    height: 0;
    top: 9px;
    border-bottom: 1px solid var(--bs-white);
}

.title .title-left h5::after,
.title .title-center h5::after {
    left: calc(100% + 15px);
}

.title .title-right h5::before,
.title .title-center h5::before {
    right: calc(100% + 15px);
}

.title .title-left h1,
.title .title-center h1,
.title .title-right h1 {
    border-bottom: 1px solid var(--bs-white);
}


/*** Service ***/
.service-item {
    position: relative;
    margin-top: 2.5rem;
    overflow: hidden;
}

.service-item .service-img {
    position: relative;
    display: inline-block;
}

.service-item .service-img::before {
    position: absolute;
    content: "";
    width: calc(100% - 12rem);
    height: calc(100% - 12rem);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3rem solid rgba(0, 0, 0, .5);
    border-radius: 300px;
    z-index: 1;
}

.service-item.service-item-left {
    border-radius: 500px 0 0 500px;
    background: linear-gradient(to right, var(--bs-secondary), var(--bs-dark));
}

.service-item.service-item-right {
    border-radius: 0 500px 500px 0;
    background: linear-gradient(to left, var(--bs-secondary), var(--bs-dark));
}

@media (max-width: 767.98px) {

    .service-item.service-item-left,
    .service-item.service-item-right {
        border-radius: 500px 500px 0 0;
        background: linear-gradient(to bottom, var(--bs-secondary), var(--bs-dark));
        text-align: center;
    }
}


/*** Team ***/
.team-item {
    position: relative;
}

.team-item .team-name {
    position: absolute;
    width: 100%;
    height: 60px;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
}

.team-item .team-body {
    position: relative;
    overflow: hidden;
}

.team-item .team-body .team-before,
.team-item .team-body .team-after {
    position: absolute;
    content: "";
    width: 0;
    height: calc(100% - 60px);
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, .7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: .5s;
}

.team-item .team-body .team-after {
    left: auto;
    right: 0;
}

.team-item .team-body .team-before {
    text-align: right;
}

.team-item:hover .team-body .team-before,
.team-item:hover .team-body .team-after {
    width: 50%;
}

.team-item .team-body .team-before span,
.team-item .team-body .team-after span {
    margin: 5px;
    color: var(--bs-white);
    opacity: 0;
    transition: .5s;
}

.team-item:hover .team-body .team-before span,
.team-item:hover .team-body .team-after span {
    opacity: 1;
    transition-delay: .2s;
}


/*** Testimonial ***/
.testimonial-carousel {
    max-width: 700px;
    margin: 0 auto;
}

.testimonial-carousel .owl-dots {
    margin-top: 35px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-carousel .owl-dots .owl-dot {
    width: 60px;
    height: 60px;
    margin: 0 5px;
    padding: 10px;
    background: var(--bs-dark);
    border-radius: 100px;
    transition: .5s;
}

.testimonial-carousel .owl-dots .owl-dot.active {
    width: 100px;
    height: 100px;
}

.testimonial-carousel .owl-dots .owl-dot img {
    opacity: .1;
    transition: .5s;
    border-radius: 100px;
}

.testimonial-carousel .owl-dots .owl-dot.active img {
    opacity: 1;
}


/*** Footer ***/
@keyframes footerAnimatedBg {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: -1000px 0;
    }
}

.footer {
    background-image: url(../img/footer-bg.png);
    background-position: 0px 0px;
    background-repeat: repeat-x;
    animation: footerAnimatedBg 50s linear infinite;
}

/* ══════════════════════════════════════════
       TEMA OSCURO (por defecto) — paleta del logo
       ══════════════════════════════════════════ */
:root {
    --logo-green: #22c55e;
    --logo-cyan: #06b6d4;
    --brand-gradient: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
    --bs-primary: #22c55e;
    --bs-primary-rgb: 34, 197, 94;

    /* superficies */
    --bg-body: #212529;
    --bg-section-alt: #2b3035;
    --bg-card: #2b3035;
    --bg-card-inner: #212529;

    /* texto */
    --text-body: #dee2e6;
    --text-heading: #ffffff;
    --text-muted-c: #9ca3af;

    /* bordes */
    --border-c: rgba(34, 197, 94, .35);
}

/* ══════════════════════════════════════════
       TEMA CLARO
       ══════════════════════════════════════════ */
[data-theme="light"] {
    --bs-primary: #16a34a;
    --bs-primary-rgb: 22, 163, 74;
    --logo-green: #16a34a;
    --logo-cyan: #0891b2;
    --brand-gradient: linear-gradient(135deg, #16a34a 0%, #0891b2 100%);

    --bg-body: #f0fdf4;
    --bg-section-alt: #e0f7e9;
    --bg-card: #ffffff;
    --bg-card-inner: #f0fdf4;

    --text-body: #1a2e1a;
    --text-heading: #0d1f0d;
    --text-muted-c: #4b5563;

    --border-c: rgba(22, 163, 74, .4);
}

/* ══════════════════════════════════════════
       TOKENS GLOBALES
       ══════════════════════════════════════════ */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body) !important;
    color: var(--text-body) !important;
    transition: background-color .35s, color .35s;
}

/* Secciones alternadas */
.bg-dark {
    background-color: var(--bg-body) !important;
}

.bg-secondary {
    background-color: var(--bg-section-alt) !important;
}

/* Cards genéricas */
.bg-secondary .bg-dark,
.service-card,
.step-card,
.stat-card {
    background-color: var(--bg-card) !important;
}

/* Feature mini-cards (about) */
.bg-dark.p-3.rounded {
    background-color: var(--bg-card-inner) !important;
}

/* Texto */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-heading) !important;
}

p,
li,
span:not(.tech-badge):not(.hero-badge):not(.highlight-text) {
    color: var(--text-body);
}

.text-muted {
    color: var(--text-muted-c) !important;
}

.text-white {
    color: var(--text-heading) !important;
}

/* Formulario */
.form-control.bg-dark {
    background-color: var(--bg-card-inner) !important;
    color: var(--text-body) !important;
    border: 1px solid var(--border-c) !important;
}

.form-floating label {
    color: var(--text-muted-c);
}

[data-theme="light"] .form-control.bg-dark {
    color: #1a2e1a !important;
}

/* Navbar */
/* ── Navbar siempre visible ── */
#mainNav {
    background: rgba(10, 18, 10, 0.82) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(34, 197, 94, .18);
    box-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}

.navbar-scrolled {
    background: rgba(5, 10, 5, 0.97) !important;
    box-shadow: 0 2px 28px rgba(0, 0, 0, .6) !important;
    border-bottom: 1px solid rgba(34, 197, 94, .35) !important;
}

/* Modo claro: navbar blanco con borde inferior degradado */
[data-theme="light"] #mainNav {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 2px solid transparent !important;
    border-image: var(--brand-gradient) 1 !important;
    box-shadow: 0 2px 20px rgba(22, 163, 74, .2) !important;
}

[data-theme="light"] .navbar-scrolled {
    background: rgba(255, 255, 255, 0.99) !important;
    box-shadow: 0 4px 28px rgba(22, 163, 74, .25) !important;
}

[data-theme="light"] #mainNav .nav-link {
    color: #1a2e1a !important;
    font-weight: 600;
}

[data-theme="light"] #mainNav .nav-link:hover,
[data-theme="light"] #mainNav .nav-link.active {
    color: var(--logo-green) !important;
}

/* Swap de logos según tema */
[data-theme="light"] #logo-dark {
    display: none !important;
}

[data-theme="light"] #logo-light {
    display: inline !important;
}

[data-theme="dark"] #logo-dark {
    display: inline !important;
}

[data-theme="dark"] #logo-light {
    display: none !important;
}

/* Tarjetas de contacto */
.bg-secondary.p-4.rounded,
.bg-secondary.p-5.rounded {
    background-color: var(--bg-card) !important;
}

.bg-primary.p-4.rounded {
    background: var(--brand-gradient) !important;
}

/* Tech badges */
.tech-badge.bg-dark {
    background-color: var(--bg-card-inner) !important;
    color: var(--text-body) !important;
}

/* Footer */
.bg-dark.text-light {
    background-color: var(--bg-body) !important;
}

[data-theme="light"] .bg-dark.text-light {
    background-color: #0d1f0d !important;
}

[data-theme="light"] .bg-dark.text-light p,
[data-theme="light"] .bg-dark.text-light li,
[data-theme="light"] .bg-dark.text-light h5 {
    color: #d1fae5 !important;
}

/* ══════════════════════════════════════════
       COMPONENTES
       ══════════════════════════════════════════ */
.btn-primary {
    background: var(--brand-gradient);
    border: none;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #15803d 0%, #0e7490 100%);
    border: none;
    box-shadow: 0 6px 20px rgba(34, 197, 94, .4);
}

.btn-outline-primary {
    color: var(--logo-green) !important;
    border-color: var(--logo-green) !important;
}

.btn-outline-primary:hover {
    background-color: var(--logo-green) !important;
    color: #fff !important;
}

.text-primary {
    color: var(--logo-green) !important;
}

.bg-primary {
    background: var(--brand-gradient) !important;
}

.border-primary {
    border-color: var(--logo-green) !important;
}

.stat-card {
    border-left: 4px solid var(--logo-green);
    transition: transform .3s;
}

.stat-card:hover {
    transform: translateY(-6px);
}

.service-card {
    transition: transform .3s, box-shadow .3s;
    border-top: 3px solid transparent;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(34, 197, 94, .25);
    border-top-color: var(--logo-green);
}

.service-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(34, 197, 94, .15);
}

.tech-badge {
    padding: .55rem 1.2rem;
    border-radius: 50px;
    font-size: .9rem;
    font-weight: 600;
    transition: transform .2s;
    cursor: default;
    border: 1px solid var(--border-c);
}

.tech-badge:hover {
    transform: scale(1.1);
}

.step-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    background: var(--brand-gradient);
    color: #fff;
}

.step-card {
    border-top: 3px solid var(--logo-green);
    transition: transform .3s;
}

.step-card:hover {
    transform: translateY(-6px);
}

.hero-badge {
    background: rgba(34, 197, 94, .15);
    border: 1px solid var(--logo-green);
    border-radius: 50px;
    padding: .4rem 1.2rem;
    display: inline-block;
    font-size: .9rem;
    letter-spacing: 2px;
    color: var(--logo-green) !important;
}

.highlight-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════
SWITCH DE TEMA (uso de clase .theme-toggle para soportar varios botones)
══════════════════════════════════════════ */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 52px;
    height: 28px;
    border-radius: 50px;
    position: relative;
    padding: 0;
    background: var(--brand-gradient);
    box-shadow: 0 2px 8px rgba(34, 197, 94, .4);
    transition: box-shadow .3s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, .6);
}

.theme-toggle .toggle-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

[data-theme="light"] .theme-toggle .toggle-thumb {
    transform: translateX(24px);
}

.theme-toggle .icon-dark {
    display: inline;
}

.theme-toggle .icon-light {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-dark {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-light {
    display: inline;
}