:root {
    --inmo-primary: #0d6efd;
    --inmo-muted: #6c757d;
}

body {
    background-color: #f5f7fa;
}

/* Navbar: por encima de cualquier .sticky-top del contenido (cards de contacto, sidebar, etc.) */
.navbar {
    position: relative;
    z-index: 1030;
}
.navbar .dropdown-menu {
    z-index: 1031;
}

/* Navbar — más visible y con estado activo claro */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.5rem 0.95rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}
.navbar-dark .navbar-nav .dropdown-toggle.show,
.navbar-dark .navbar-nav .dropdown-toggle:focus {
    color: #fff;
}

.listing-card .card-img-top {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.listing-price {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--inmo-primary);
}

.verified-badge {
    background-color: #d1e7dd;
    color: #0f5132;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.agency-logo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
    background-color: #e9ecef;
}

.photo-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
}

/* Feedback visual de campos obligatorios vs opcionales */
.form-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}
.form-label:not(.required):not(.form-check-label)::after {
    content: " (opcional)";
    color: #6c757d;
    font-size: 0.82em;
    font-weight: 400;
    font-style: italic;
}
.required-hint {
    padding: 0.5rem 0.85rem;
    background-color: #f8f9fa;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 1rem;
}
.required-hint .req-mark {
    color: #dc3545;
    font-weight: 700;
}

/* Phone input con código de país — asegura legibilidad del select */
.phone-input-group .form-select {
    background-position: right 0.4rem center;
    padding-right: 1.6rem;
    padding-left: 0.5rem;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* Drag & drop de fotos del anuncio */
.photo-item {
    position: relative;
    cursor: grab;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 4px;
    background: #fff;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.photo-item:hover {
    border-color: #dee2e6;
}
.photo-item.dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.photo-item.drag-over {
    border-color: var(--inmo-primary);
    transform: scale(1.02);
}
.photo-cover-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(13, 110, 253, 0.92);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    pointer-events: none;
}
.photo-position-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(33, 37, 41, 0.85);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    pointer-events: none;
}
.photo-move-controls {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}
.photo-move-controls button {
    padding: 0.15rem 0.55rem;
    line-height: 1;
    font-size: 0.95rem;
}
.photo-move-controls button:disabled {
    opacity: 0.35;
}

.empty-state {
    padding: 4rem 1rem;
    text-align: center;
    color: var(--inmo-muted);
}

/* Blog */
.blog-card .card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.blog-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #212529;
}
.blog-body h2,
.blog-body h3,
.blog-body h4 {
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}
.blog-body h2 { font-size: 1.6rem; }
.blog-body h3 { font-size: 1.3rem; }
.blog-body h4 { font-size: 1.1rem; }
.blog-body p { margin-bottom: 1.1rem; }
.blog-body ul,
.blog-body ol { margin-bottom: 1.1rem; padding-left: 1.4rem; }
.blog-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 1rem 0; }
.blog-body blockquote {
    border-left: 4px solid var(--inmo-primary);
    padding: 0.4rem 1rem;
    color: #495057;
    font-style: italic;
    background: #f8f9fa;
    margin: 1.2rem 0;
}
.blog-body code {
    background: #f1f3f5;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.95em;
}
.blog-body pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
}
.blog-body pre code { background: transparent; padding: 0; }
.blog-body table {
    width: 100%;
    margin: 1.2rem 0;
    border-collapse: collapse;
}
.blog-body table th,
.blog-body table td {
    border: 1px solid #dee2e6;
    padding: 0.45rem 0.7rem;
    text-align: left;
}
.blog-body table th { background: #f8f9fa; }
.blog-body a { color: var(--inmo-primary); }
.blog-body .heading-anchor { color: inherit; text-decoration: none; }
.blog-body .heading-anchor:hover { text-decoration: underline; }

/* Listing carousel — discourage casual image copying/saving. Can be bypassed by
   determined users, but stops drag-to-desktop and the default 'Save image as…' menu. */
.protected-img {
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}
.protected-frame {
    position: relative;
}
.protected-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}
.protected-frame .carousel-control-prev,
.protected-frame .carousel-control-next,
.protected-frame .carousel-indicators {
    z-index: 3;
}

/* Checklist de publicación */
.publish-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.publish-checklist li {
    padding: 0.4rem 0;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.15s ease;
}
.publish-checklist li [data-icon] {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.publish-checklist li.checklist-done {
    color: #198754;
}
.publish-checklist li.checklist-done [data-icon] {
    background-color: #d1e7dd;
    color: #198754;
}
