/* ===== FOOTER BASE ===== */
footer {
  width: 100%;
  position: relative; /* estado base */
  background-color: #007bff;
  padding-top: 50px;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7), 0 -3px 10px rgba(0, 60, 255, .9);
}

/* FIXED */
footer.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  transform: translateY(0);
  opacity: 1;
}

/* Salida animada */
footer.footer-unfixed {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Estado oculto */
body.footer-hidden footer {
  opacity: 0;
  transform: translateY(10px); /* leve desplazamiento */
  pointer-events: none;
}

/* Footer links contenedor */
footer .footer-links,
footer .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Footer columnas */
footer .col-md-4,
footer .col-md-3,
footer .col-md-1 {
    margin-bottom: 20px;
}

/* Footer bottom icons y texto */
footer strong,
footer span.h5,
footer .ti-email,
footer .ti-html5,
footer .ti-css3 {
color: #333;
}

footer p{
font-weight:600;
}

/**/
footer,
footer a{
color: #80c1ff;
font-weight:600;
}

footer a:hover{
color: #fff;
text-decoration: underline;
}

/* ===== RESPONSIVE FOOTER ===== */
/* Mobile horizontal (576px a 767px) - mantener 3 columnas */
@media (max-width: 767px) and (min-width: 576px) {
    footer .container {
        width: 95% !important;      /* Contenedor más ancho */
        max-width: 95%;
        padding-left: 0;
        padding-right: 0;
    }

    footer .row {
        justify-content: space-between; /* espacio entre columnas */
    }

    footer .col-md-4,
    footer .col-md-3 {
        flex: 0 0 30%;        /* 3 columnas visibles */
        max-width: 30%;
        margin-bottom: 20px;  /* margen inferior entre filas */
        text-align: left;     /* alineación izquierda */
    }

    footer .text-md-left {
        text-align: left !important;
    }
    #footerSgwd {
        flex-direction: row;          /* todo en una fila */
        justify-content: center;      /* centrado horizontal */
        gap: 20px;
    }
    
}


/* Móviles pequeños <576px - apilar columnas */
@media (max-width: 575px) {
    footer .container {
        width: 95%;
        padding-left: 0;
        padding-right: 0;
    }
    footer .col-md-4,
    footer .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0 auto 20px;
        text-align: center;
    }
    footer .text-md-left {
        text-align: center !important;
    }
    #footerSgwd {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ===== BOTONES FLUTUANTES ===== */
.toggle-theme, .back-to-top {
    position: absolute;
    bottom: 45px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background-color: #303030;
    color: #fff;
}

/* separación horizontal */
.back-to-top { right: 15px; font-size: 20px; }
.toggle-theme { right: 75px; font-size: 30px; }

.toggle-theme:focus,
.back-to-top:focus {
    outline: none;
    box-shadow: none;
}

/* =========================
   FOOTER
========================= */
body.theme-alt footer{
box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7), 0 -3px 10px rgba(232, 68, 68, .9);
}

body.theme-alt .footerSgwd,
body.theme-alt footer,
body.theme-alt footer a{
  /*background-color: var(--bg-row);*/
  /*background-color: rgb(21, 33, 59,1);*/
  color: rgba(255, 255, 255, .55);
  background: var(--theme-oscuro-glass) !important;
}

body.theme-alt footer strong,
body.theme-alt footer span.h5,
body.theme-alt footer .ti-email,
body.theme-alt footer .ti-html5,
body.theme-alt footer .ti-css3 {
    color: #E84444;
}

body.theme-alt footer .back-to-top,
body.theme-alt footer .toggle-theme{
    background:#E84444;
}

/* ===== BORDER BOTTOM ===== */
footer .border-bottom {
    border-bottom: 1px solid #333 !important;
    padding-bottom:35px;
}
body.theme-alt footer .border-bottom {
    border-bottom: 1px solid #E84444 !important;
}

/* zoom en hover para ambos botones */
.toggle-theme,
.back-to-top {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.toggle-theme:hover,
.back-to-top:hover {
    transform: scale(1.2); /* agranda el botón al pasar el mouse */
}

/**/
footer .navbar-brand {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    opacity: 0.7;
    transition: filter 0.5s ease, opacity 0.5s ease;
}
footer .navbar-brand:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
    opacity: 0.9;
}

body.theme-alt footer .navbar-brand {
    filter: drop-shadow(0 4px 8px rgba(232, 68, 68, 0.4));
}
/*
body.theme-alt footer .navbar-brand:hover {
    filter: drop-shadow(0 6px 12px rgba(232, 68, 68, 0.6));
}
*/

/**/
/* theme-indicator */
#theme-indicator {
  position: fixed;
  bottom: 7px;
  right: 7px;
  width: auto;
  text-align: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  z-index: 9999;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 6px; /* separación entre LED y título */
  background-color: rgba(0,0,0,0.4); /* sutil */
  color: #eee;
  -webkit-user-select: none; /* Safari/Chrome */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE10+ */
  user-select: none;         /* estándar */
  /*cursor: pointer;*/
}

#theme-indicator:hover {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

/* LED estilo ojo/led */
#theme-led {
  opacity: 0.5;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #aaa;  /* apagado */
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* LED encendido */
#theme-led.active {
  background-color: #E84444; 
  box-shadow: 0 0 6px rgba(255, 141, 150, 0.7);
}

/* Título dentro del indicador */
#theme-title {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}


/* ===== LIGHT ===== */
/**/
#footerSgwd {
    width: 100%;         /* ocupa todo el ancho */
    padding: 15px;
    height: 70px;
    display: flex;
    justify-content: space-between; /* grupos a los extremos en desktop */
    align-items: center;
    flex-wrap: nowrap;    /* no permitir salto de línea */
}

#cardClick {
  display: flex;
  width: fit-content; /* Se ajusta al contenido */
  gap: 0.5rem;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

#cardClick span.h5 {
  margin: 0;                 /* Quita margenes innecesarios */
}

#cardClick i {
  display: inline-flex;       /* Para que flex items internos se alineen */
  justify-content: center;
  align-items: center;
}

/* Contenedor principal */
/* El contenedor que abarca todo */
#card-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 10001;
    overflow: hidden;
}

/* El fondo oscuro */
.overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7); /* Oscurece la web detrás */
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

#card-container.is-active .overlay-bg {
    opacity: 1;
}

body.theme-alt .overlay-bg {
    background: rgba(0, 0, 0, 0.7); /* Oscurece la web detrás */
}

/* Contenedor de las tarjetas alineado abajo */
/* 1. ESTADO BASE (Cerrado / Salida) */
.modal-cards {
    position: absolute;
    bottom: 0px;
    left: 50%;
    /* Centrado horizontal + Desplazado 100% hacia abajo para esconderlo */
    transform: translate(-50%, 100%); 
    width: 100%; 
    height: 400px;
    z-index: 2;
    background: transparent !important;
    border: none !important;
    opacity: 0; /* Opcional: para que desvanezca mientras baja */
    
    /* Control de la animación de salida */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

/* 2. ESTADO ACTIVO (Abierto / Entrada) */
#card-container.is-active .modal-cards {
    display: block; 
    opacity: 1;
    /* Mantiene el centrado horizontal y vuelve a su posición vertical original */
    transform: translate(-50%, 0); 
}

/* Estado inicial (oculto abajo) */
/*
#card-container:not(.is-active) .modal-cards {
    transform: translate(-50%, 100%);
}
*/

#card-container iframe {
    border: 0 !important;
    border-width: 0 !important;
    outline: none !important;
    /* Algunos navegadores ponen un fondo sutil que parece un borde */
    background-color: transparent !important;
}

/* En el CSS del PADRE */
.close-x {
    position: absolute;
    /* Ajusta estos valores para que "flote" sobre la esquina superior derecha del abanico */
    bottom: 280px; 
    right: calc(20%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px); /* Efecto cristal */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
}

.close-x:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: transparent;
}

/* Para pantallas móviles (Vertical) */
@media (max-width: 575px) {
    #card-container .modal-cards {
        width: 100% !important; 
        height: 100% !important; /* Para que el iframe tenga donde crecer */
        bottom: 0 !important;
        left: 0 !important;
        transform: translate(0, 100%); /* Reseteamos el translate de desktop */
    }

    #card-container.is-active .modal-cards {
        transform: translate(0, 0) !important;
    }

    /* El botón de cerrar debe estar dentro del área visible */
    .close-x {
        bottom: 520px !important; /* Ajustado al nuevo alto del mazo vertical */
        right: 40px !important;
    }
}