/* ============================================================
   BuscaloTu - Estilos Principales
   Mobile First | Dark Mode | Bootstrap 5
   ============================================================ */

/* ─── FUENTE ─────────────────────────────────────────────── */
:root {
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;

    /* Colores de marca */
    --bt-primary:      #2563EB;
    --bt-primary-dark: #1D4ED8;
    --bt-accent:       #F59E0B;
    --bt-success:      #10B981;
    --bt-danger:       #EF4444;

    /* Light mode */
    --bt-bg:           #F8FAFC;
    --bt-bg-card:      #FFFFFF;
    --bt-border:       #E2E8F0;
    --bt-text:         #1E293B;
    --bt-text-muted:   #64748B;
    --bt-navbar-bg:    rgba(255,255,255,0.95);
    --bt-footer-bg:    #1E293B;
    --bt-footer-text:  #CBD5E1;
    --bt-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --bt-shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --bt-shadow-lg:    0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --bt-radius:       12px;
    --bt-radius-sm:    8px;
    --bt-radius-lg:    20px;
}

[data-bs-theme="dark"] {
    --bt-bg:          #0F172A;
    --bt-bg-card:     #1E293B;
    --bt-border:      #334155;
    --bt-text:        #F1F5F9;
    --bt-text-muted:  #94A3B8;
    --bt-navbar-bg:   rgba(15,23,42,0.97);
    --bt-shadow:      0 1px 3px rgba(0,0,0,.3);
    --bt-shadow-md:   0 4px 6px rgba(0,0,0,.3);
    --bt-shadow-lg:   0 10px 15px rgba(0,0,0,.4);
}

/* ─── BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--bt-bg);
    color: var(--bt-text);
    font-size: 15px;
    line-height: 1.6;
    transition: background-color .3s, color .3s;
}

/* ─── NAVBAR ─────────────────────────────────────────────── */
.navbar-main {
    background: var(--bt-navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow);
    transition: background .3s;
    z-index: 1030;
}

.navbar-main .navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -.5px;
    text-decoration: none;
}

.navbar-search {
    width: 100%;
    max-width: 420px;
}

.navbar-search .form-control {
    background: var(--bt-bg);
    border-color: var(--bt-border);
    color: var(--bt-text);
    border-radius: var(--bt-radius-sm) 0 0 var(--bt-radius-sm);
    padding: .5rem 1rem;
}

.navbar-search .form-control:focus {
    box-shadow: none;
    border-color: var(--bt-primary);
    background: var(--bt-bg-card);
}

/* ─── HERO / BUSCADOR PRINCIPAL ──────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.hero-subtitle {
    color: rgba(255,255,255,.85);
    font-size: 1.1rem;
}

/* Caja de búsqueda hero */
.hero-search-box {
    background: var(--bt-bg-card);
    border-radius: var(--bt-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--bt-shadow-lg), 0 0 0 1px rgba(255,255,255,.1);
}

.hero-search-box .form-control,
.hero-search-box .form-select {
    background: var(--bt-bg);
    border-color: var(--bt-border);
    color: var(--bt-text);
    padding: .75rem 1rem;
    border-radius: var(--bt-radius-sm) !important;
    font-size: .95rem;
}

.hero-search-box .form-control:focus,
.hero-search-box .form-select:focus {
    border-color: var(--bt-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.btn-search-hero {
    background: var(--bt-primary);
    color: #fff;
    border: none;
    padding: .75rem 2rem;
    border-radius: var(--bt-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: background .2s, transform .1s;
    width: 100%;
}

.btn-search-hero:hover {
    background: var(--bt-primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* ─── TARJETAS DE RESULTADO ──────────────────────────────── */
.listing-card {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
    height: 100%;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bt-shadow-lg);
}

.listing-card.destacada {
    border-color: var(--bt-accent);
    box-shadow: var(--bt-shadow), 0 0 0 2px rgba(245,158,11,.2);
}

.listing-card-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--bt-radius-sm);
    flex-shrink: 0;
}

.listing-card-img-placeholder {
    width: 72px;
    height: 72px;
    border-radius: var(--bt-radius-sm);
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.8rem;
    color: var(--bt-primary);
}

.badge-plan {
    font-size: .7rem;
    font-weight: 600;
    padding: .25rem .6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.badge-plan.gratuito    { background: #F1F5F9; color: #64748B; }
.badge-plan.destacado   { background: #FEF3C7; color: #92400E; }
.badge-plan.profesional { background: #EDE9FE; color: #5B21B6; }
.badge-plan.empresa     { background: #ECFDF5; color: #065F46; }

[data-bs-theme="dark"] .badge-plan.gratuito { background: #334155; color: #94A3B8; }

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: var(--bt-radius-sm);
    font-weight: 500;
    font-size: .85rem;
    transition: background .2s;
}
.btn-whatsapp:hover { background: #128C7E; color: #fff; }

.btn-contact {
    background: var(--bt-bg);
    color: var(--bt-text);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-sm);
    font-size: .85rem;
    transition: all .2s;
}
.btn-contact:hover {
    background: var(--bt-primary);
    color: #fff;
    border-color: var(--bt-primary);
}

/* ─── CATEGORÍAS (HOME) ──────────────────────────────────── */
.category-card {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--bt-text);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: block;
    box-shadow: var(--bt-shadow);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--bt-shadow-md);
    border-color: var(--bt-primary);
    color: var(--bt-primary);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.4rem;
    transition: transform .2s;
}

.category-card:hover .category-icon { transform: scale(1.1); }

.category-name {
    font-size: .88rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.category-count {
    font-size: .75rem;
    color: var(--bt-text-muted);
    margin-top: .15rem;
}

/* ─── SECCIÓN GENÉRICA ───────────────────────────────────── */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bt-text);
    margin-bottom: .35rem;
}

.section-subtitle {
    color: var(--bt-text-muted);
    font-size: .95rem;
    margin-bottom: 2rem;
}

/* ─── FILTROS DE BÚSQUEDA ────────────────────────────────── */
.filter-sidebar {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 1.5rem;
    box-shadow: var(--bt-shadow);
    position: sticky;
    top: 80px;
}

.filter-sidebar h6 {
    font-weight: 600;
    color: var(--bt-text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .75rem;
}

/* ─── PERFIL PÚBLICO ─────────────────────────────────────── */
.profile-hero {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    padding: 2rem;
    box-shadow: var(--bt-shadow-md);
}

.profile-avatar {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--bt-radius);
    border: 3px solid var(--bt-border);
    box-shadow: var(--bt-shadow-md);
}

.badge-verificado {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    border-radius: 20px;
    padding: .25rem .75rem;
    font-size: .75rem;
    font-weight: 600;
}

/* ─── PANEL DE USUARIO ───────────────────────────────────── */
.panel-sidebar {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    overflow: hidden;
    box-shadow: var(--bt-shadow);
}

.panel-sidebar .nav-link {
    color: var(--bt-text-muted);
    padding: .75rem 1.25rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

.panel-sidebar .nav-link:hover,
.panel-sidebar .nav-link.active {
    background: rgba(37,99,235,.08);
    color: var(--bt-primary);
}

.panel-sidebar .nav-link.active {
    font-weight: 600;
    border-right: 3px solid var(--bt-primary);
}

/* Stat cards en panel */
.stat-card {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--bt-shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--bt-primary);
}

.stat-label {
    font-size: .8rem;
    color: var(--bt-text-muted);
    margin-top: .25rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ─── FORMULARIOS ────────────────────────────────────────── */
.form-card {
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    padding: 2rem;
    box-shadow: var(--bt-shadow-md);
}

.form-control, .form-select {
    background-color: var(--bt-bg) !important;
    border-color: var(--bt-border) !important;
    color: var(--bt-text) !important;
    border-radius: var(--bt-radius-sm) !important;
    padding: .6rem 1rem;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bt-primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15) !important;
    background-color: var(--bt-bg-card) !important;
}

.form-label {
    font-weight: 500;
    font-size: .9rem;
    color: var(--bt-text);
    margin-bottom: .35rem;
}

/* ─── AUTOCOMPLETE ───────────────────────────────────────── */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bt-bg-card);
    border: 1px solid var(--bt-border);
    border-top: none;
    border-radius: 0 0 var(--bt-radius-sm) var(--bt-radius-sm);
    box-shadow: var(--bt-shadow-lg);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: background .1s;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background: rgba(37,99,235,.08);
    color: var(--bt-primary);
}

/* ─── ESTRELLAS ──────────────────────────────────────────── */
.star-rating .bi { font-size: .9rem; }
.rating-number   { font-weight: 600; color: var(--bt-text); }
.rating-count    { font-size: .8rem; color: var(--bt-text-muted); }

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer-main {
    background: var(--bt-footer-bg);
    color: var(--bt-footer-text);
    border-top: 1px solid rgba(255,255,255,.05);
}

[data-bs-theme="dark"] .footer-main {
    background: #020617;
}

.footer-main a { color: var(--bt-footer-text); transition: color .2s; }
.footer-main a:hover { color: #fff; }

/* ─── BADGES ESTADO ──────────────────────────────────────── */
.badge-estado-pendiente  { background: #FEF3C7; color: #92400E; }
.badge-estado-aprobada   { background: #D1FAE5; color: #065F46; }
.badge-estado-rechazada  { background: #FEE2E2; color: #991B1B; }
.badge-estado-suspendida { background: #F1F5F9; color: #475569; }

[data-bs-theme="dark"] .badge-estado-pendiente  { background: #451A03; color: #FCD34D; }
[data-bs-theme="dark"] .badge-estado-aprobada   { background: #022C22; color: #6EE7B7; }
[data-bs-theme="dark"] .badge-estado-rechazada  { background: #450A0A; color: #FCA5A5; }

/* ─── ADMIN PANEL ────────────────────────────────────────── */
.admin-sidebar {
    background: #1E293B;
    min-height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform .3s;
    display: flex;
    flex-direction: column;
}

.admin-sidebar .nav-link {
    color: #94A3B8;
    padding: .7rem 1.5rem;
    font-size: .9rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .7rem;
    transition: background .15s, color .15s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.admin-sidebar .nav-link.active { border-left: 3px solid #3B82F6; }

.admin-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    background: var(--bt-bg);
}

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

/* ─── UTILIDADES ─────────────────────────────────────────── */
.rounded-bt    { border-radius: var(--bt-radius) !important; }
.rounded-bt-sm { border-radius: var(--bt-radius-sm) !important; }
.rounded-bt-lg { border-radius: var(--bt-radius-lg) !important; }

.bg-card  { background: var(--bt-bg-card) !important; }
.bg-main  { background: var(--bt-bg) !important; }
.border-bt { border-color: var(--bt-border) !important; }
.text-bt-muted { color: var(--bt-text-muted) !important; }

.shadow-bt    { box-shadow: var(--bt-shadow) !important; }
.shadow-bt-md { box-shadow: var(--bt-shadow-md) !important; }
.shadow-bt-lg { box-shadow: var(--bt-shadow-lg) !important; }

/* Loader spinner */
.bt-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--bt-border);
    border-top-color: var(--bt-primary);
    border-radius: 50%;
    animation: bt-spin .7s linear infinite;
}
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .navbar-search { max-width: 100%; margin: .5rem 0; }
    .hero-section  { padding: 3rem 0 2.5rem; }
    .hero-search-box { padding: 1rem; }
    .listing-card-img,
    .listing-card-img-placeholder { width: 56px; height: 56px; }
}
