/* =========================================================
   Tierras Atlas - Estilos base
   Paleta: tonos tierra y verde
   ========================================================= */

:root {
    --atlas-verde-oscuro: #2f3e2e;
    --atlas-verde: #4a6b3d;
    --atlas-verde-claro: #7ea172;
    --atlas-tierra: #a9784f;
    --atlas-tierra-claro: #d9b48f;
    --atlas-arena: #f4ede2;
    --atlas-texto: #2b2620;
    --bs-primary: var(--atlas-verde);
    --bs-primary-rgb: 74, 107, 61;
    --fuente-titulos: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --fuente-texto: 'Lato', 'Segoe UI', Roboto, Arial, sans-serif;
    --fuente-marca: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
}

html {
    height: 100%;
}

body {
    font-family: var(--fuente-texto);
    color: var(--atlas-texto);
    background-color: var(--atlas-arena);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* El contenido entre el navbar y el footer crece para llenar el espacio
   sobrante, asi el footer siempre queda pegado abajo aunque la pagina
   tenga poco contenido (en vez de depender solo de un margin-top:auto). */
.contenido-principal {
    flex: 1 0 auto;
}

.footer-atlas {
    flex-shrink: 0;
}

a {
    color: var(--atlas-verde);
}

a:hover {
    color: var(--atlas-verde-oscuro);
}

/* Navbar */
.navbar {
    background-color: var(--atlas-verde-oscuro);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    color: #fff;
}

.navbar-brand {
    color: #fff !important;
    font-family: var(--fuente-marca);
    letter-spacing: 0.02em;
}

.marca-logo {
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    vertical-align: middle;
}

/* Selector de idioma */
.selector-idioma .bandera {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.selector-idioma .bandera-generica {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--atlas-tierra);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
}

.selector-idioma .dropdown-toggle::after {
    margin-left: 0.3rem;
}

.selector-idioma .dropdown-menu {
    min-width: auto;
}

.selector-idioma .dropdown-item.active {
    background-color: var(--atlas-verde);
}

/* Botones */
.btn-primary {
    background-color: var(--atlas-verde);
    border-color: var(--atlas-verde);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--atlas-verde-oscuro);
    border-color: var(--atlas-verde-oscuro);
}

.btn-outline-primary {
    color: var(--atlas-verde);
    border-color: var(--atlas-verde);
}

.btn-outline-primary:hover {
    background-color: var(--atlas-verde);
    border-color: var(--atlas-verde);
}

.btn-tierra {
    background-color: var(--atlas-tierra);
    border-color: var(--atlas-tierra);
    color: #fff;
}

.btn-tierra:hover {
    background-color: #8a5f3c;
    border-color: #8a5f3c;
    color: #fff;
}

/* Hero: carrusel de fotos de portada + un solo boton encima */
.hero-atlas {
    position: relative;
    min-height: 680px;
    overflow: hidden;
}

.hero-carrusel,
.hero-carrusel-vacio {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-carrusel .carousel-inner,
.hero-carrusel .carousel-item {
    height: 100%;
}

.hero-carrusel .carousel-item {
    position: relative;
}

.hero-carrusel-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--atlas-verde-oscuro);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-carrusel-vacio {
    background-color: var(--atlas-verde-oscuro);
}

.hero-boton-ampliar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
}

.hero-lightbox-imagen {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.hero-lightbox-cerrar {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

/* El boton flota encima del carrusel, abajo a la izquierda (misma posicion
   que tenia antes). El resto del area deja pasar los clics para que las
   flechitas de prev/next del carrusel sigan funcionando. */
.hero-boton-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    padding-bottom: 3.5rem;
    pointer-events: none;
}

.hero-boton-overlay .btn {
    pointer-events: auto;
}

/* Seccion "Bienvenido" (Home): titulo centrado + texto centrado */
.bienvenida-titulo {
    font-family: var(--fuente-titulos);
    font-size: 3rem;
    font-weight: 700;
    color: var(--atlas-verde-oscuro);
}

.bienvenida-texto {
    max-width: 900px;
    font-size: 1.2rem;
    line-height: 1.85;
}

.bienvenida-destacado {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--atlas-tierra);
    margin-bottom: 1.5rem;
}

.bienvenida-lista {
    padding-left: 1.25rem;
}

.bienvenida-lista li {
    margin-bottom: 0.5rem;
}

.bienvenida-lista li::marker {
    color: var(--atlas-tierra);
}

.bienvenida-checklist {
    list-style: none;
    padding-left: 1.25rem;
}

.bienvenida-checklist li {
    margin-bottom: 0.4rem;
}

.bienvenida-checklist .bi-check-lg {
    color: var(--atlas-verde);
    font-weight: 700;
    margin-right: 0.35rem;
}

.bienvenida-telefono {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--atlas-verde-oscuro);
    margin-top: 1.5rem;
}

.bienvenida-telefono a {
    color: var(--atlas-tierra);
    text-decoration: none;
}

.bienvenida-telefono a:hover {
    text-decoration: underline;
}

/* Tarjetas de terrenos */
.card-terreno {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(43, 38, 32, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.card-terreno:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(43, 38, 32, 0.15);
}

.card-terreno .card-img-top {
    height: 200px;
    object-fit: cover;
    background-color: var(--atlas-tierra-claro);
}

.badge-estado-disponible {
    background-color: var(--atlas-verde);
}

.badge-estado-alquilado {
    background-color: var(--atlas-tierra);
}

.badge-destacado {
    background-color: #c99a3c;
}

.precio-terreno {
    color: var(--atlas-verde-oscuro);
    font-weight: 700;
}

/* Seccion sobre nosotros */
.seccion-sobre-nosotros {
    background-color: var(--atlas-arena);
    padding: 7rem 0;
}

/* Mapa en contacto */
.mapa-contacto iframe {
    display: block;
    min-height: 360px;
}

.contacto-titulo {
    font-family: var(--fuente-titulos);
    font-weight: 700;
    color: var(--atlas-tierra);
}

/* Footer */
.footer-atlas {
    background-color: var(--atlas-verde-oscuro);
    color: rgba(255, 255, 255, 0.85);
}

.footer-atlas a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.footer-atlas a:hover {
    color: #fff;
}

.footer-redes {
    display: flex;
    gap: 0.75rem;
}

.footer-redes a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    font-size: 1.05rem;
    transition: background-color 0.2s ease;
}

.footer-redes a:hover {
    background-color: var(--atlas-tierra);
}

/* Galeria de imagenes en ficha de terreno */
.galeria-principal img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.galeria-miniaturas img {
    height: 90px;
    width: 100%;
    object-fit: cover;
    border-radius: 0.4rem;
    cursor: pointer;
    opacity: 0.7;
}

.galeria-miniaturas img:hover,
.galeria-miniaturas img.activa {
    opacity: 1;
    outline: 2px solid var(--atlas-verde);
}

/* Flechas del lightbox */
.lightbox-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    opacity: 0.75;
}

.lightbox-flecha:hover {
    opacity: 1;
}

.lightbox-flecha-izq {
    left: 0.75rem;
}

.lightbox-flecha-der {
    right: 0.75rem;
}

/* Selector de tema de color (Configuracion > Tema del sitio) */
.tema-swatch-label {
    cursor: pointer;
}

.tema-swatch-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tema-swatch {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.tema-swatch-input:checked + .tema-swatch {
    border-color: var(--atlas-verde);
    transform: scale(1.08);
}

.tema-swatch-input:focus-visible + .tema-swatch {
    outline: 2px solid var(--atlas-verde);
    outline-offset: 2px;
}

/* Selector de fuentes (Configuracion > Fuentes del sitio) */
.fuente-swatch-label {
    cursor: pointer;
}

.fuente-swatch-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.fuente-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    padding: 1rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #fff;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.fuente-swatch-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--atlas-verde-oscuro);
    line-height: 1.2;
}

.fuente-swatch-texto {
    font-size: 0.8rem;
    color: var(--atlas-texto);
    margin-top: 0.15rem;
}

.fuente-swatch-nombre {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    margin-top: 0.5rem;
}

.fuente-swatch-input:checked + .fuente-swatch {
    border-color: var(--atlas-verde);
    transform: scale(1.04);
}

.fuente-swatch-input:focus-visible + .fuente-swatch {
    outline: 2px solid var(--atlas-verde);
    outline-offset: 2px;
}

/* Panel admin */
.admin-sidebar {
    background-color: var(--atlas-verde-oscuro);
    color: #fff;
}

.admin-sidebar a {
    color: rgba(255, 255, 255, 0.85);
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

@media (min-width: 992px) {
    .admin-sidebar {
        width: 240px;
        flex-shrink: 0;
        min-height: 100vh;
    }
}

/* Panel admin: sidebar se vuelve barra horizontal en pantallas chicas */
@media (max-width: 991.98px) {
    .admin-sidebar .nav {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .admin-sidebar .nav-item.mt-4 {
        margin-top: 0 !important;
    }
}

@media (max-width: 767.98px) {
    .hero-atlas {
        min-height: 520px;
    }

    .hero-boton-overlay {
        padding-bottom: 2rem;
    }

    .hero-boton-overlay .btn-lg {
        width: 80%;
    }

    .galeria-principal img {
        height: 260px;
    }

    /* Footer: centrado y compacto en movil */
    .footer-atlas .row {
        --bs-gutter-y: 0.25rem;
    }

    .footer-atlas .row > div {
        text-align: center;
        margin-bottom: 0.75rem;
    }

    .footer-atlas .row > div:last-child {
        margin-bottom: 0;
    }

    .footer-atlas .footer-redes {
        justify-content: center;
    }

    .footer-atlas ul.list-unstyled {
        padding-left: 0;
        margin-bottom: 0;
    }

    .footer-atlas h5,
    .footer-atlas h6 {
        margin-bottom: 0.4rem;
    }

    .footer-atlas p.small {
        margin-bottom: 0.5rem;
    }
}
