/* ============================================================
   TEMA.CSS — Sistema de diseño compartido del marketplace
   Inclúyelo en TODAS las páginas (login, registro, admin, 
   catálogo, formularios) para mantener todo consistente.
   Estilo: deportivo, juvenil, moderno. Soporta modo día/noche.
   ============================================================ */

:root {
    /* Marca */
    --naranja: #FF5A1F;
    --naranja-oscuro: #E64A0F;
    --azul-electrico: #0057FF;
    --amarillo: #FFD23F;
    --verde: #14C48A;
    --rojo: #FF4D4D;

    /* Modo claro (default) */
    --fondo: #F5F7FA;
    --superficie: #FFFFFF;
    --superficie-2: #F0F4FF;
    --texto: #0B1120;
    --texto-secundario: #667085;
    --borde: #EDEFF3;
    --sombra: rgba(11, 17, 32, 0.10);
}

[data-theme="dark"] {
    --fondo: #0B1120;
    --superficie: #161D2E;
    --superficie-2: #1E2740;
    --texto: #F2F4F8;
    --texto-secundario: #9AA3B8;
    --borde: #2A3350;
    --sombra: rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--fondo);
    color: var(--texto);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============ HEADER DE MARCA ============ */
.header-app {
    background: linear-gradient(120deg, var(--azul-electrico) 0%, var(--naranja) 100%);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 4px 16px var(--sombra);
}
.header-app__marca {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}
.header-app__marca .icono {
    width: 38px; height: 38px;
    background: white;
    color: var(--naranja);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transform: rotate(-6deg);
    flex-shrink: 0;
}
.header-app__marca h5 {
    margin: 0;
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.header-app__acciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botón para alternar modo día/noche */
.btn-tema {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-tema:hover { background: rgba(255,255,255,0.32); }

.btn-salir {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-salir:hover { background: rgba(255,255,255,0.28); color: white; }

/* ============ TARJETAS ============ */
.card-app {
    background: var(--superficie);
    border: none;
    border-radius: 20px;
    box-shadow: 0 6px 20px var(--sombra);
    color: var(--texto);
}

.card-fila {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 2px 8px var(--sombra);
}

/* ============ BOTONES ============ */
.btn-app {
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 10px 18px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.btn-app:active { transform: translateY(1px); }
.btn-app.w-100 { width: 100%; }

.btn-primario { background: var(--naranja); color: white; box-shadow: 0 8px 18px rgba(255,90,31,0.3); }
.btn-primario:hover { background: var(--naranja-oscuro); color: white; }

.btn-exito { background: var(--verde); color: white; }
.btn-peligro { background: var(--rojo); color: white; }
.btn-whatsapp-app { background: #25D366; color: white; }
.btn-secundario { background: var(--superficie-2); color: var(--azul-electrico); }
.btn-plano { background: var(--borde); color: var(--texto-secundario); }

/* ============ FORMULARIOS ============ */
.form-label-app {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--texto);
    margin-bottom: 6px;
    display: block;
}
.form-control-app {
    width: 100%;
    border-radius: 14px;
    border: 2px solid var(--borde);
    padding: 12px 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    background: var(--superficie);
    color: var(--texto);
}
.form-control-app:focus {
    outline: none;
    border-color: var(--azul-electrico);
    box-shadow: 0 0 0 4px rgba(0, 87, 255, 0.12);
}
.form-select-app { border-radius: 14px; border: 2px solid var(--borde); padding: 12px 14px; background: var(--superficie); color: var(--texto); }

/* ============ ALERTAS ============ */
.alerta-app { border-radius: 14px; border: none; font-weight: 500; font-size: 0.85rem; padding: 12px 16px; }
.alerta-app.error { background: #FFE5E0; color: #C4361A; }
[data-theme="dark"] .alerta-app.error { background: #3A1A15; color: #FF8A6B; }
.alerta-app.aviso { background: #FFF6DC; color: #997800; }
[data-theme="dark"] .alerta-app.aviso { background: #332C0F; color: #FFD75E; }
.alerta-app.exito { background: #E9FBF4; color: #0F9D6F; }
[data-theme="dark"] .alerta-app.exito { background: #0F2A22; color: #4FE3B4; }

/* ============ BADGES / ETIQUETAS ============ */
.badge-app {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    display: inline-block;
}
.badge-categoria { background: var(--naranja); color: white; }
.badge-confianza {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--superficie-2); color: var(--azul-electrico);
    font-size: 0.72rem; font-weight: 700;
    padding: 6px 12px; border-radius: 20px;
}

/* ============ ACORDEÓN (usado en admin y menús) ============ */
.acordeon-app .accordion-item {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: 16px !important;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px var(--sombra);
}
.acordeon-app .accordion-button {
    background: var(--superficie);
    color: var(--texto);
    font-weight: 800;
    font-size: 0.9rem;
    padding: 16px 18px;
}
.acordeon-app .accordion-button:not(.collapsed) {
    background: var(--superficie-2);
    color: var(--azul-electrico);
    box-shadow: none;
}
.acordeon-app .accordion-button::after { filter: none; }
[data-theme="dark"] .acordeon-app .accordion-button::after { filter: invert(1); }
.acordeon-app .accordion-body { padding: 14px 18px 18px; }

/* ============ AVATARES ============ */
.avatar-circulo {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--azul-electrico); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
    overflow: hidden;
}
.avatar-circulo img { width: 100%; height: 100%; object-fit: cover; }

.foto-producto-app {
    width: 56px; height: 56px; border-radius: 12px;
    object-fit: cover; flex-shrink: 0; background: var(--superficie-2);
}

/* ============ RESPONSIVO ============ */
/* Las filas de datos (usuario/producto + botones) se apilan en pantallas chicas */
.fila-app {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.fila-app__info { flex: 1 1 200px; min-width: 0; }
.fila-app__acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}
@media (min-width: 576px) {
    .fila-app__acciones { width: auto; }
}

.vacio-app { text-align: center; padding: 40px 0; color: var(--texto-secundario); }
.vacio-app i { font-size: 2rem; }
