/* =========================================================
   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;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--atlas-texto);
    background-color: var(--atlas-arena);
}

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;
}

.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 */
.hero-atlas {
    position: relative;
    min-height: 620px;
    overflow: hidden;
}

/* Capa 1: la foto, realmente difuminada (no un efecto raro de backdrop-filter) */
/* La imagen se pone inline en index.php (fondo dinamico desde Configuracion) */
.hero-fondo-img {
    position: absolute;
    inset: -30px;
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    filter: blur(14px) saturate(1.1) brightness(1.02);
    transform: scale(1.1);
    z-index: 0;
}

/* Capa 2: degradado de marca para que el texto se lea bien arriba */
.hero-atlas::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(244, 237, 226, 0.94) 0%,
        rgba(244, 237, 226, 0.85) 32%,
        rgba(244, 237, 226, 0.5) 62%,
        rgba(244, 237, 226, 0.18) 100%
    );
    z-index: 1;
}

.hero-atlas .container {
    position: relative;
    z-index: 2;
}

.hero-titulo {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--atlas-verde-oscuro);
}

.hero-subtitulo {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--atlas-tierra);
}

.hero-links a {
    display: block;
    color: var(--atlas-verde-oscuro);
    text-decoration: underline;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.hero-links a:hover {
    color: var(--atlas-tierra);
}

/* 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: #fff;
    padding: 4rem 0;
}

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

/* 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;
}

/* 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: 460px;
    }

    .hero-titulo {
        font-size: 2.1rem;
    }

    .hero-atlas .btn-lg {
        width: 100%;
    }

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