/* Variables CSS */
:root {
    --font-primary: 'Open Sans', sans-serif;
    --font-headings: 'Poppins', sans-serif;
    --color-primary: #e74c3c;
    --color-primary-dark: #c0392b;
    --color-dark: #2c3e50;
    --color-whatsapp: #25D366;
    --color-whatsapp-dark: #128C7E;
    --border-radius: 0.5rem;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --body-bg: #f0f0f0;
    --footer-bg: #e74c3c;
}

/* Estilos generales */
body {
    background-color: var(--body-bg);
    font-family: var(--font-primary);
    color: #333;
    padding-top: 60px; /* Adjusted for smaller navbar height */
    margin: 0; /* Reset default body margin */
}

/* Header */
.contenedor-header {
    margin: 0; /* Ensure no margins cause overflow */
    overflow: hidden; /* Prevent content from spilling out */
}

.contenedor-header.sticky-top {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1030;
}

/* Navbar adjustments */
.navbar-nav .nav-link {
    padding: 0.4rem 0.5rem; /* Tighter padding for mobile */
    font-size: 0.85rem; /* Smaller font for better fit */
    white-space: nowrap; /* Prevent text wrapping */
}

.navbar-nav .btn {
    margin: 0.2rem 0; /* Minimal margin for buttons */
    padding: 0.4rem 0.5rem; /* Match nav-link padding */
    width: 100%; /* Full-width in collapsed menu */
    text-align: left; /* Align with links */
    font-size: 0.85rem; /* Match nav-link font size */
}

.navbar-collapse {
    flex-grow: 1; /* Ensure collapse takes available space */
}

/* Dropdown menu for mobile */
.dropdown-menu {
    width: 100%; /* Full-width in collapsed menu */
    max-width: 280px; /* Slightly smaller for mobile */
    font-size: 0.85rem; /* Match nav-link font size */
}

/* Ensure navbar fits on very small screens */
@media (max-width: 360px) {
    .navbar-brand {
        font-size: 0.8rem; /* Even smaller for tiny screens */
    }

    .navbar-nav .nav-link,
    .navbar-nav .btn {
        font-size: 0.8rem; /* Smaller font for tiny screens */
        padding: 0.3rem 0.4rem; /* Tighter padding */
    }

    .material-icons {
        font-size: 1rem; /* Smaller icons for tiny screens */
    }
}

/* Footer */
.bg-footer {
    background-color: var(--footer-bg) !important;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
}

.bg-footer a {
    transition: color 0.3s ease;
}

.bg-footer a:hover {
    color: var(--color-primary-dark);
}

/* Estilos para index.php y propiedades.php */
.home .display-4 {
    font-family: var(--font-headings);
    color: var(--color-dark);
}

.home .text-muted {
    font-family: var(--font-primary);
}

/* Estilos para propiedades.php y busqueda.php */
.property-card,
.resultado {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
}

.property-card:hover,
.resultado:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.contenedor-imagen,
.property-image {
    overflow: hidden;
    height: 200px;
}

.contenedor-imagen img,
.property-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .property-image,
.resultado:hover .contenedor-imagen img {
    transform: scale(1.05);
}

.card-body.info {
    padding: 1rem;
}

.card-title.titulo,
.card-title {
    font-family: var(--font-headings);
    font-size: 1.25rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-text {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detalles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dato1 {
    flex: 1 1 80px;
    min-width: 80px;
    max-width: 100%;
}

.dato1 .header,
.dato1 small {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primary);
}

.dato1 .texto,
.dato1 span {
    font-size: 0.85rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    font-size: 0.8rem;
    padding: 0.5rem;
}




/* Estilos para captaciondeinmuebles.php */
.video-container {
    max-width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

.caption {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-family: var(--font-headings);
    color: var(--color-dark);
    text-align: center;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Estilos para publicacion.php */
.property-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}

.gallery-thumbnail {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: var(--box-shadow);
}

.property-price {
    color: var(--color-primary);
    font-weight: 700;
}

.contact-form {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

/* Estilos para login y register */
.card {
    border-radius: var(--border-radius);
}

/* Estilos para dashboards */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Botones */
.btn-whatsapp {
    background-color: var(--color-whatsapp);
    color: white;
    font-weight: 600;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    position: relative;
    z-index: 1;
}

.btn-whatsapp::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-whatsapp-dark);
    z-index: -1;
    border-radius: var(--border-radius);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.btn-whatsapp:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-whatsapp:hover {
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .contenedor-imagen,
    .property-image {
        height: 150px;
    }

    .card-title.titulo,
    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.85rem;
    }

    .dato1 {
        flex: 1 1 60px;
        min-width: 60px;
    }

    .gallery-thumbnail {
        height: 80px;
    }

    .bg-footer {
        padding: 1rem 0;
    }

    .bg-footer .d-flex {
        flex-direction: column;
        gap: 1rem;
    }

    .caption {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .detalles {
        flex-direction: column;
        gap: 0.5rem;
    }

    .dato1 {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .navbar-brand {
        font-size: 0.85rem;
    }

    .navbar-nav .nav-link,
    .navbar-nav .btn {
        font-size: 0.85rem;
    }
}
  /* Forzar controles siempre visibles - funciona principalmente en Chrome/Edge/Safari */
video.video-with-controls::-webkit-media-controls {
    opacity: 1 !important;
    display: flex !important;
    visibility: visible !important;
}

video.video-with-controls::-webkit-media-controls-panel {
    opacity: 1 !important;
    display: flex !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* Evitar que se oculten con transiciones o focus perdido */
video.video-with-controls::-webkit-media-controls-enclosure {
    opacity: 1 !important;
    display: block !important;
}

/* Para Firefox (mejor soporte nativo, pero reforzamos) */
video.video-with-controls {
    --controls-opacity: 1 !important;
}

/* General: mantener pointer events activos */
.video-container:hover video::-webkit-media-controls,
.video-container video::-webkit-media-controls {
    opacity: 1 !important;
    visibility: visible !important;
}
.video-container {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;          /* evita desbordes raros */
}

.video-full-content {
    width: 100% !important;
    height: auto !important;   /* respeta la proporción original del video */
    max-width: 800px;
    display: block;
    object-fit: contain;       /* muestra TODO el video sin cortarlo */
    background: #000;          /* fondo negro por si hay barras */
}
