/* =============================================
   VENDELOAQUI - Rediseno Profesional v2
   Inspirado en Encuentra24 + identidad propia
   ============================================= */

/* Font loaded via header.php link tag */

:root {
    --primary:       #16a34a;
    --primary-dark:  #15803d;
    --primary-light: #f0fdf4;
    --primary-mid:   #dcfce7;
    --accent:        #f59e0b;
    --accent-dark:   #d97706;
    --red:           #dc2626;
    --success:       #16a34a;
    --danger:        #dc2626;
    --dark:          #111827;
    --dark-2:        #1f2937;
    --gray:          #6b7280;
    --gray-light:    #9ca3af;
    --light:         #f9fafb;
    --white:         #ffffff;
    --border:        #e5e7eb;
    --border-dark:   #d1d5db;
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
    --shadow:        0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:     0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;
    --font:          'Inter', system-ui, sans-serif;
}

/* ===================== TEMA OSCURO ===================== */
/* Solo redefine variables semanticas: todo lo que usa var() cambia solo. */
[data-theme="dark"] {
    --primary-light: #14251b;   /* fondos verdes tenues */
    --primary-mid:   #16351f;
    --dark:          #e5e7eb;    /* texto principal (invertido) */
    --dark-2:        #0b1220;    /* topbar / barras oscuras */
    --gray:          #9ca3af;
    --gray-light:    #6b7280;
    --light:         #0f172a;    /* fondo de la pagina */
    --white:         #1e293b;    /* fondo de tarjetas */
    --border:        #334155;
    --border-dark:   #475569;
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.4);
    --shadow:        0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.4);
    --shadow-lg:     0 10px 15px rgba(0,0,0,0.55), 0 4px 6px rgba(0,0,0,0.4);
    color-scheme: dark;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--light); color: var(--dark); line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
* { -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
input, select, textarea { font-size: 16px !important; }

/* ===================== TOPBAR ===================== */
.topbar {
    background: var(--dark-2);
    color: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar a { color: rgba(255,255,255,0.7); transition: color 0.15s; }
.topbar a:hover { color: white; }
.topbar-links { display: flex; gap: 16px; }

/* ===================== NAVBAR ===================== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 62px;
    gap: 14px;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-brand .verde { color: var(--primary); }

.search-wrap { flex: 1; max-width: 520px; }

.search-box {
    display: flex;
    background: var(--light);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

.search-box input {
    flex: 1;
    padding: 9px 18px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    outline: none;
    font-family: var(--font);
}

.search-box button {
    padding: 9px 18px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
    border-radius: 0 50px 50px 0;
}

.search-box button:hover { background: var(--primary-dark); }

.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.nav-link {
    color: var(--gray);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover { background: var(--light); color: var(--dark); }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
}

.btn-nav-publish {
    background: var(--primary) !important;
    color: white !important;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-nav-publish:hover { background: var(--primary-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,163,74,0.3); }

/* ===================== NAV CATEGORIAS ===================== */
.nav-cats {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-cats::-webkit-scrollbar { display: none; }
.nav-cats-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 0;
}
.nav-cat-link {
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-cat-link:hover { color: var(--primary); border-bottom-color: var(--primary-mid); }
.nav-cat-link.activo { color: var(--primary); border-bottom-color: var(--primary); }
.nav-cat-link svg { flex-shrink: 0; }

/* ===================== HERO ===================== */
.hero {
    background: var(--light);
    color: var(--dark);
    padding: 48px 20px 52px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-inner { max-width: 620px; margin: 0 auto; text-align: center; position: relative; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--dark);
}
.hero h1 span { color: #16a34a; }
.hero p { font-size: 0.95rem; color: var(--gray); margin-bottom: 28px; }

.hero-search {
    display: flex;
    max-width: 540px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    transition: border-color 0.15s;
}
.hero-search:focus-within { border-color: #16a34a; }

.hero-search input {
    flex: 1;
    padding: 13px 20px;
    border: none;
    font-size: 0.92rem;
    outline: none;
    font-family: var(--font);
    color: var(--dark);
}

.hero-search button {
    padding: 13px 26px;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    transition: background 0.15s;
}

.hero-search button:hover { background: var(--primary-dark); }

/* ===================== CONTENEDOR ===================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===================== CATEGORIAS GRID ===================== */
.section-wrap { padding: 28px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title { font-size: 1.1rem; font-weight: 800; color: var(--dark); letter-spacing: -0.3px; }
.section-link { font-size: 0.82rem; color: var(--primary); font-weight: 600; }
.section-count { font-size: 0.78rem; color: var(--gray-light); font-weight: 500; margin-left: 8px; }

.categorias-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.cat-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--dark);
    display: block;
    position: relative;
}

.cat-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cat-icon {
    width: 44px; height: 44px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
    color: var(--primary);
    transition: background 0.15s;
}
.cat-card:hover .cat-icon { background: var(--primary-mid); }
.cat-name { font-size: 0.75rem; font-weight: 600; line-height: 1.3; color: var(--dark-2); }
.cat-count { font-size: 0.65rem; color: var(--gray-light); margin-top: 3px; }

/* ===================== PRODUCTOS GRID ===================== */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
}

.producto-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.badge-destacado {
    position: absolute; top: 10px; left: 10px;
    background: var(--accent); color: white;
    padding: 3px 10px; border-radius: 50px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.3px; text-transform: uppercase; z-index: 1;
}

.badge-negociable {
    position: absolute; top: 10px; left: 10px;
    background: rgba(22,163,74,0.9); color: white;
    padding: 3px 8px; border-radius: 50px;
    font-size: 0.65rem; font-weight: 700; z-index: 1;
}

.badge-precio-fijo {
    position: absolute; top: 10px; left: 10px;
    background: rgba(220,38,38,0.85); color: white;
    padding: 3px 8px; border-radius: 50px;
    font-size: 0.65rem; font-weight: 700; z-index: 1;
}
.badge-vendido {
    position: absolute; top: 10px; left: 10px;
    background: rgba(51,65,85,0.9); color: white;
    padding: 3px 10px; border-radius: 50px;
    font-size: 0.65rem; font-weight: 700; z-index: 1;
}

/* Boton favorito */
.btn-fav {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: all 0.15s;
    color: var(--gray-light);
}
.btn-fav:hover { color: var(--danger); transform: scale(1.1); }
.btn-fav.activo { color: var(--danger); }
.btn-fav svg { width: 16px; height: 16px; }

.prod-img-wrap { position: relative; }

.producto-card .prod-img {
    width: 100%; height: 185px; object-fit: cover;
    transition: transform 0.3s;
}
.producto-card:hover .prod-img { transform: scale(1.03); }

.producto-card .prod-img-wrap { overflow: hidden; }

.producto-card .prod-no-img {
    width: 100%; height: 185px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex; align-items: center; justify-content: center;
    color: var(--border-dark);
}

.prod-info { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }

.prod-precio {
    font-size: 1.15rem; font-weight: 800;
    color: var(--primary); letter-spacing: -0.5px; margin-bottom: 3px;
}

.prod-precio-dolares { font-size: 0.78rem; color: var(--gray); font-weight: 500; margin-bottom: 3px; }

.precio-antes { text-decoration: line-through; color: var(--gray); font-weight: 500; font-size: 0.82rem; margin-left: 4px; }
.badge-descuento { background: #dc2626; color: white; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 3px; vertical-align: middle; }

.prod-titulo {
    font-weight: 600; font-size: 0.88rem;
    color: var(--dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 5px;
}

.prod-desc {
    font-size: 0.78rem; color: var(--gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1; margin-bottom: 8px;
}

.prod-meta {
    display: flex; gap: 8px; flex-wrap: wrap;
    font-size: 0.72rem; color: var(--gray-light);
    margin-top: auto;
}

.btn-ver-prod {
    display: block; text-align: center;
    padding: 10px; background: var(--primary-light);
    color: var(--primary); font-weight: 700;
    font-size: 0.82rem; border-top: 1px solid var(--primary-mid);
    transition: all 0.15s;
}
.btn-ver-prod:hover { background: var(--primary); color: white; }

/* ========= EMPLEO CARD (estilo limpio sin foto) ========= */
.empleo-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 18px 16px 14px;
    position: relative;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.empleo-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.empleo-card-top {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2px;
}
.empleo-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}
.empleo-card-titulo {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 8px;
}
.empleo-card-empresa {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}
.empleo-card-empresa svg { color: var(--gray); flex-shrink: 0; }
.empleo-card-ubicacion {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--gray);
    margin-bottom: 6px;
}
.empleo-card-ubicacion svg { color: var(--gray-light); flex-shrink: 0; }
.empleo-card-jornada {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}
.empleo-card-jornada svg { color: var(--primary); flex-shrink: 0; }
.empleo-card-desc {
    font-size: 0.78rem;
    color: var(--gray);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}
.empleo-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s;
}
.empleo-card-btn:hover { background: var(--primary-dark); }
.empleo-card-btn svg { flex-shrink: 0; }

/* ===================== BOTONES ===================== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    border: none; cursor: pointer;
    font-size: 0.88rem; font-weight: 600;
    transition: all 0.15s; text-decoration: none;
    font-family: var(--font);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--accent); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: var(--light); color: var(--dark); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-dark); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 13px 24px; font-size: 0.95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-pill { border-radius: 50px; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.85rem; color: var(--dark-2); }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.9rem; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: var(--font); background: var(--white); color: var(--dark);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ===================== CARDS ===================== */
.card { background: var(--white); border-radius: var(--radius); border: 1.5px solid var(--border); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1.5px solid var(--border); color: var(--dark); }

/* ===================== ALERTS ===================== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.88rem; font-weight: 500; border-left: 3px solid; }
.alert-success { background: #f0fdf4; color: #166534; border-color: var(--primary); }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: var(--accent); }

/* ===================== BADGES ===================== */
.badge { display: inline-block; padding: 3px 9px; border-radius: 50px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: var(--gray); }

/* ===================== FILTROS ===================== */
.filtros-wrap {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filtros-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 14px; color: var(--dark); }

.filtros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.filtro-grupo label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--gray); margin-bottom: 4px; }

.filtro-grupo select,
.filtro-grupo input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    font-family: var(--font);
    color: var(--dark);
    background: var(--white);
    transition: border-color 0.15s;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus { border-color: var(--primary); }

.precio-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.precio-range input { flex: 1; }
.precio-range span { color: var(--gray-light); font-size: 0.8rem; }

/* ===================== DETALLE PRODUCTO ===================== */
.detalle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.galeria-principal img {
    width: 100%; border-radius: var(--radius);
    max-height: 420px; object-fit: cover;
    border: 1.5px solid var(--border);
    cursor: zoom-in;
}

.galeria-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.galeria-thumbs img {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer; transition: border-color 0.15s;
}
.galeria-thumbs img.activa { border-color: var(--primary); }
.galeria-thumbs img:hover { border-color: var(--primary-mid); }

.precio-grande { font-size: 2.1rem; font-weight: 900; color: var(--primary); letter-spacing: -1px; margin: 10px 0 4px; }
.precio-usd { font-size: 0.9rem; color: var(--gray); margin-bottom: 12px; }

.detalle-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.detalle-tag {
    background: var(--light); border: 1px solid var(--border);
    border-radius: 50px; padding: 4px 12px;
    font-size: 0.75rem; font-weight: 600; color: var(--gray);
    display: flex; align-items: center; gap: 4px;
}

.vendedor-box {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--light);
    border-radius: var(--radius); border: 1.5px solid var(--border); margin: 16px 0;
}

.vendedor-avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.1rem; font-weight: 800; flex-shrink: 0;
}

.btn-contactar {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px;
    background: var(--primary); color: white;
    font-weight: 700; font-size: 1rem;
    border: none; cursor: pointer;
    border-radius: var(--radius); transition: all 0.15s;
    text-decoration: none; margin-bottom: 10px;
}
.btn-contactar:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,163,74,0.3); }

.btn-fav-grande {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px;
    background: var(--white); color: var(--gray);
    font-weight: 600; font-size: 0.9rem;
    border: 1.5px solid var(--border); cursor: pointer;
    border-radius: var(--radius); transition: all 0.15s;
    margin-bottom: 16px;
}
.btn-fav-grande:hover { border-color: var(--danger); color: var(--danger); }
.btn-fav-grande.activo { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

/* ===================== PANEL ===================== */
.panel-wrap { max-width: 920px; margin: 24px auto; padding: 0 16px; }
.panel-header { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.panel-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.3rem; font-weight: 800; flex-shrink: 0; }
.panel-nav { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); display: flex; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav a { padding: 13px 18px; font-size: 0.85rem; font-weight: 600; color: var(--gray); white-space: nowrap; border-bottom: 2px solid transparent; transition: all 0.15s; text-decoration: none; }
.panel-nav a:hover { color: var(--primary); }
.panel-nav a.activo { color: var(--primary); border-bottom-color: var(--primary); }
.panel-nav a.danger { color: var(--danger); }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-num { font-size: 1.9rem; font-weight: 900; letter-spacing: -1px; color: var(--primary); }
.stat-lbl { font-size: 0.75rem; color: var(--gray); margin-top: 3px; font-weight: 500; }
.tabla-wrap { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tabla-header { padding: 14px 18px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.anuncio-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.anuncio-item:last-child { border-bottom: none; }
.anuncio-item:hover { background: var(--light); }
.anuncio-thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); overflow: hidden; background: var(--light); flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.anuncio-thumb img { width: 100%; height: 100%; object-fit: cover; }
.anuncio-info { flex: 1; min-width: 0; }
.anuncio-titulo { font-weight: 700; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anuncio-meta { font-size: 0.75rem; color: var(--gray); margin-top: 2px; }
.anuncio-acciones { display: flex; gap: 6px; flex-shrink: 0; }

/* ===================== FAVORITOS ===================== */
.favoritos-empty { text-align: center; padding: 48px 20px; color: var(--gray); }
.favoritos-empty svg { color: var(--border-dark); margin: 0 auto 16px; }

/* ===================== PAGINACION ===================== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a { padding: 8px 14px; background: var(--white); border-radius: var(--radius-sm); border: 1.5px solid var(--border); color: var(--dark); font-weight: 600; font-size: 0.85rem; transition: all 0.15s; }
.pagination a:hover, .pagination a.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ===================== FOOTER ===================== */
footer {
    background: #1a1f2b;
    color: #6b7280;
    padding: 40px 20px 24px;
    margin-top: 40px;
}
.footer-inner { max-width: 800px; margin: 0 auto; }
.footer-top { padding-bottom: 24px; border-bottom: 1px solid #2d3343; margin-bottom: 20px; }
.footer-cols { display: grid !important; grid-template-columns: 1.4fr 1fr 1fr !important; gap: 32px; }
.footer-col { min-width: 0; }
.footer-col-title { font-weight: 700; color: white; font-size: 0.78rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col-links a { display: block; color: #9ca3af; font-size: 0.8rem; margin-bottom: 7px; transition: color 0.15s; text-decoration: none; }
.footer-col-links a:hover { color: #4ade80; }
.footer-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.footer-paises { padding-bottom: 20px; border-bottom: 1px solid #2d3343; margin-bottom: 20px; }
.footer-paises-title { font-size: 0.82rem; color: #9ca3af; margin-bottom: 10px; }
.footer-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-flag-btn {
    width: 40px; height: 32px; border-radius: 6px;
    background: #232838; border: 1.5px solid #2d3343;
    cursor: pointer; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; padding: 0;
}
.footer-flag-btn:hover { border-color: #4ade80; background: #2d3343; }
.footer-flag-btn.activo { border-color: #4ade80; background: #2d3343; box-shadow: 0 0 0 2px rgba(74,222,128,0.3); }

.footer-brand-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding-bottom: 24px; margin-bottom: 24px;
    border-bottom: 1px solid #2d3343;
}
.footer-desc { font-size: 0.8rem; color: #9ca3af; line-height: 1.5; margin-top: 6px; max-width: 320px; }
.footer-brand-text { font-size: 1.2rem; font-weight: 900; color: white; letter-spacing: -0.5px; }
.footer-brand-text .verde { color: #4ade80; }
.footer-social { display: flex; gap: 8px; align-items: center; }
.footer-social a { width: 34px; height: 34px; background: #232838; border: 1px solid #2d3343; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #9ca3af; transition: all 0.15s; text-decoration: none; }
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: white; }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.75rem; color: #6b7280; flex-wrap: wrap; gap: 8px;
}

/* ===================== ADMIN ===================== */
.admin-wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.admin-topbar { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.admin-nav { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); display: flex; overflow-x: auto; margin-bottom: 20px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { padding: 12px 18px; font-size: 0.85rem; font-weight: 600; color: var(--gray); white-space: nowrap; border-bottom: 2px solid transparent; transition: all 0.15s; text-decoration: none; }
.admin-nav a:hover { color: var(--primary); }
.admin-nav a.activo { color: var(--primary); border-bottom-color: var(--primary); }
.admin-nav a.danger { color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { background: var(--light); padding: 10px 14px; text-align: left; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray); border-bottom: 1.5px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
tr:hover td { background: var(--light); }
.table-responsive { overflow-x: auto; }

/* ===================== MISC ===================== */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    .footer-cols { gap: 24px; }
}

@media (max-width: 768px) {
    .topbar { display: none; }
    .navbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
    .search-wrap { order: 3; width: 100%; max-width: 100%; }
    .hero h1 { font-size: 1.6rem; }
    .hero-stats { gap: 20px; }
    .categorias-grid { grid-template-columns: repeat(4, 1fr); }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .detalle-grid { grid-template-columns: 1fr; }
    .filtros-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .productos-grid { grid-template-columns: repeat(2, 1fr); }
    .categorias-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-cols { grid-template-columns: 1fr 1fr !important; gap: 20px; }
    .footer-brand-row { flex-direction: column; }
}

@media (min-width: 600px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===================== CTA BANNER ===================== */
.cta-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    margin-bottom: 32px;
    color: white;
}
.cta-banner h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 8px; letter-spacing: -0.5px; }
.cta-banner p { opacity: 0.85; margin-bottom: 20px; font-size: 0.92rem; }
.cta-btn {
    background: var(--white); color: var(--primary);
    padding: 12px 28px; border-radius: 50px;
    font-weight: 800; font-size: 0.95rem;
    display: inline-block; transition: transform 0.15s;
}
.cta-btn:hover { transform: translateY(-2px); }

/* ===================== CHAT ===================== */
.msg-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; min-height: 520px; }
.msg-sidebar { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.msg-panel { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--dark); transition: background 0.1s; }
.conv-item:hover { background: var(--light); }
.conv-item.activa { background: var(--primary-light); border-left: 3px solid var(--primary); }
.conv-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-nombre { font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-prev { font-size: 0.75rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-hora { font-size: 0.7rem; color: var(--gray-light); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; min-height: 280px; max-height: 400px; }
.burbuja { max-width: 72%; padding: 9px 13px; border-radius: 14px; font-size: 0.88rem; line-height: 1.5; word-break: break-word; }
.burbuja.mia { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 3px; }
.burbuja.suya { background: var(--white); color: var(--dark); align-self: flex-start; border: 1.5px solid var(--border); border-bottom-left-radius: 3px; }
.burbuja .b-autor { font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.7); margin-bottom: 2px; }
.burbuja.suya .b-autor { color: var(--primary); }
.burbuja .b-hora { font-size: 0.65rem; opacity: 0.6; margin-top: 4px; text-align: right; }
.chat-form { display: flex; border-top: 1.5px solid var(--border); background: var(--white); }
.chat-form input { flex: 1; padding: 13px 16px; border: none; outline: none; font-size: 0.9rem; font-family: var(--font); }
.chat-form button { padding: 13px 20px; background: var(--primary); color: white; border: none; cursor: pointer; font-weight: 700; font-size: 0.85rem; transition: background 0.15s; }
.chat-form button:hover { background: var(--primary-dark); }
@media (max-width: 768px) {
    .msg-layout { grid-template-columns: 1fr; }
}

/* ===================== MODAL (confirm/alert bonito) ===================== */
.lv-modal-ov {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(17,24,39,0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; transition: opacity 0.18s;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.lv-modal-ov.show { opacity: 1; }
.lv-modal {
    background: var(--white); border-radius: 16px;
    max-width: 380px; width: 100%; padding: 24px 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.28);
    border: 1px solid var(--border);
    transform: translateY(10px) scale(0.98); transition: transform 0.18s;
}
.lv-modal-ov.show .lv-modal { transform: none; }
.lv-modal-title { font-size: 1.05rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.lv-modal-msg { font-size: 0.92rem; color: var(--gray); line-height: 1.5; margin-bottom: 22px; }
.lv-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.lv-modal-btn {
    padding: 10px 18px; border-radius: 10px; font-size: 0.9rem;
    font-weight: 700; font-family: inherit; cursor: pointer; border: none;
    transition: background 0.12s, filter 0.12s;
}
.lv-modal-cancel { background: var(--light); color: var(--dark); border: 1.5px solid var(--border); }
.lv-modal-cancel:hover { background: var(--border); }
.lv-modal-ok { background: var(--primary); color: #fff; }
.lv-modal-ok:hover { background: var(--primary-dark); }
.lv-modal-danger { background: var(--danger); color: #fff; }
.lv-modal-danger:hover { filter: brightness(0.92); }
@media (max-width: 480px) {
    .lv-modal-actions { flex-direction: column-reverse; }
    .lv-modal-btn { width: 100%; }
}

/* ===== OVERLAY DE CARGA GLOBAL ===== */
.lv-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 10000;
}
.lv-loading.show { display: flex; }
.lv-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: lv-spin 0.8s linear infinite;
}
.lv-loading-text { font-size: 0.95rem; color: var(--gray); font-weight: 600; }
@keyframes lv-spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .lv-loading { background: rgba(17, 24, 39, 0.92); }

/* Footer en dark mode */
[data-theme="dark"] footer { background: #0f172a; color: #6b7280; }
[data-theme="dark"] .footer-top { border-bottom-color: #1e293b; }
[data-theme="dark"] .footer-col-title { color: #e5e7eb; }
[data-theme="dark"] .footer-col-links a { color: #9ca3af; }
[data-theme="dark"] .footer-paises { border-bottom-color: #1e293b; }
[data-theme="dark"] .footer-flag-btn { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .footer-flag-btn:hover { border-color: #4ade80; background: #334155; }
[data-theme="dark"] .footer-brand-row { border-bottom-color: #1e293b; }
[data-theme="dark"] .footer-brand-text { color: #e5e7eb; }

/* =============================================
   BLOG
   ============================================= */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.blog-card { display: flex; flex-direction: column; background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); text-decoration: none; color: inherit; transition: box-shadow .2s; }
.blog-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.blog-card-img { height: 180px; overflow: hidden; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-no-img { color: #94a3b8; }
.blog-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.blog-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--gray); flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-date { font-size: 0.78rem; color: #94a3b8; margin-top: 10px; }
.blog-content { font-size: 1rem; line-height: 1.75; color: #374151; }
.blog-content h2 { font-size: 1.25rem; font-weight: 700; margin: 28px 0 12px; }
.blog-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 10px; }
.blog-content p { margin-bottom: 16px; }
.blog-content ul, .blog-content ol { margin: 0 0 16px 20px; }
.blog-content li { margin-bottom: 6px; }
.blog-content strong { font-weight: 600; }
.blog-content a { color: var(--primary); text-decoration: underline; }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }
[data-theme="dark"] .blog-card { background: #1e293b; }
[data-theme="dark"] .blog-card-no-img { background: #334155; }
[data-theme="dark"] .blog-content { color: #e5e7eb; }
[data-theme="dark"] .footer-social a { background: #1e293b; color: #9ca3af; }
