/* =====================================================================
   BP Mis Servicios - Estilos
   Compatible con BuddyPress + SocialV Theme
   ===================================================================== */

:root {
    --bms-primary:      #2563eb;
    --bms-primary-dark: #1d4ed8;
    --bms-secondary:    #64748b;
    --bms-success:      #16a34a;
    --bms-danger:       #dc2626;
    --bms-bg:           #f8fafc;
    --bms-card-bg:      #ffffff;
    --bms-border:       #e2e8f0;
    --bms-text:         #1e293b;
    --bms-text-muted:   #64748b;
    --bms-radius:       12px;
    --bms-radius-sm:    8px;
    --bms-shadow:       0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --bms-shadow-hover: 0 4px 12px rgba(37,99,235,.15), 0 8px 32px rgba(0,0,0,.08);
    --bms-transition:   0.22s cubic-bezier(.4,0,.2,1);
}

/* =====================================================================
   SECCIÓN PROMINENTE EN EL PERFIL
   ===================================================================== */

.bms-perfil-principal {
    background: var(--bms-card-bg);
    border: 1px solid var(--bms-border);
    border-radius: var(--bms-radius);
    padding: 28px 32px;
    margin: 0 0 24px 0;
    box-shadow: var(--bms-shadow);
}

.bms-perfil-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bms-perfil-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bms-perfil-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bms-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.bms-perfil-rol {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: var(--bms-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.bms-perfil-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Grid de servicios */
.bms-servicios-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.bms-servicios-grid > .bms-servicio-card {
    flex: 1 1 260px !important;
    min-width: 260px !important;
    max-width: 100% !important;
}

.bms-servicio-card {
    background: var(--bms-bg);
    border: 1px solid var(--bms-border);
    border-radius: var(--bms-radius-sm);
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    transition: transform var(--bms-transition), box-shadow var(--bms-transition), border-color var(--bms-transition);
    animation: bmsCardIn 0.4s ease both;
}

@keyframes bmsCardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bms-servicio-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bms-shadow-hover);
    border-color: #bfdbfe;
}

.bms-servicio-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bms-primary);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.bms-servicio-descripcion {
    font-size: 0.9rem;
    color: var(--bms-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* Perfil vacío (CTA) */
.bms-perfil-vacio {
    background: var(--bms-card-bg);
    border: 2px dashed var(--bms-border);
    border-radius: var(--bms-radius);
    padding: 32px;
    margin: 0 0 24px 0;
    text-align: center;
}

.bms-vacio-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bms-vacio-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.bms-vacio-inner p {
    color: var(--bms-text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* =====================================================================
   BADGE EN EL HEADER (SocialV)
   ===================================================================== */

.bms-badge-header {
    display: inline-flex;
    margin: 0 8px;
}

.bms-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37,99,235,.1);
    color: var(--bms-primary) !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none !important;
    transition: background var(--bms-transition), transform var(--bms-transition);
}

.bms-badge-link:hover {
    background: rgba(37,99,235,.18);
    transform: scale(1.04);
}

.bms-badge-icon {
    font-size: 0.9rem;
}

/* =====================================================================
   BOTONES
   ===================================================================== */

.bms-btn-primary,
.bms-btn-secondary,
.bms-btn-editar,
.bms-btn-mensaje {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--bms-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    border: none;
    transition: background var(--bms-transition), transform var(--bms-transition), box-shadow var(--bms-transition);
    line-height: 1.2;
}

.bms-btn-primary {
    background: var(--bms-primary);
    color: #fff !important;
}

.bms-btn-primary:hover {
    background: var(--bms-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.bms-btn-secondary {
    background: transparent;
    color: var(--bms-secondary) !important;
    border: 1.5px solid var(--bms-border);
}

.bms-btn-secondary:hover {
    background: var(--bms-bg);
    border-color: var(--bms-secondary);
}

.bms-btn-editar {
    background: transparent;
    color: var(--bms-primary) !important;
    border: 1.5px solid #bfdbfe;
    font-size: 0.8rem;
    padding: 6px 14px;
}

.bms-btn-editar:hover {
    background: #eff6ff;
}

.bms-btn-mensaje {
    background: var(--bms-primary);
    color: #fff !important;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.bms-btn-mensaje:hover {
    background: var(--bms-primary-dark);
    transform: translateY(-1px);
}

/* =====================================================================
   PESTAÑA: VER SERVICIOS
   ===================================================================== */

.bms-tab-ver {
    padding: 8px 0;
}

.bms-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.bms-tab-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bms-text);
    margin: 0;
}

.bms-tab-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 24px;
    text-align: center;
    color: var(--bms-text-muted);
}

.bms-tab-vacio .bms-vacio-icon {
    font-size: 3rem;
}

/* Sección de contacto en la pestaña */
.bms-contacto-seccion {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--bms-border);
}

.bms-contacto-seccion h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bms-text);
    margin: 0 0 16px 0;
}

.bms-mensaje-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 560px;
}

.bms-login-cta {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bms-bg);
    border-radius: var(--bms-radius-sm);
    font-size: 0.9rem;
    color: var(--bms-text-muted);
}

.bms-login-cta a {
    color: var(--bms-primary);
    font-weight: 600;
}

/* =====================================================================
   PESTAÑA: GESTIONAR SERVICIOS
   ===================================================================== */

.bms-tab-gestionar {
    padding: 8px 0;
}

.bms-gestionar-intro {
    font-size: 0.9rem;
    color: var(--bms-text-muted);
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.bms-bloques-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.bms-bloque {
    background: var(--bms-card-bg);
    border: 1px solid var(--bms-border);
    border-radius: var(--bms-radius-sm);
    overflow: hidden;
    transition: box-shadow var(--bms-transition);
    animation: bmsBlockIn 0.3s ease both;
}

@keyframes bmsBlockIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bms-bloque:focus-within {
    box-shadow: 0 0 0 2px #bfdbfe;
    border-color: var(--bms-primary);
}

.bms-bloque-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bms-bg);
    border-bottom: 1px solid var(--bms-border);
}

.bms-bloque-numero {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bms-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bms-btn-eliminar-bloque {
    background: none;
    border: none;
    color: var(--bms-danger);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: background var(--bms-transition);
    opacity: 0.6;
}

.bms-btn-eliminar-bloque:hover {
    background: #fee2e2;
    opacity: 1;
}

.bms-bloque-campos {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Inputs y textareas */
.bms-input,
.bms-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--bms-border);
    border-radius: var(--bms-radius-sm);
    font-size: 0.9rem;
    color: var(--bms-text);
    background: #fff;
    transition: border-color var(--bms-transition), box-shadow var(--bms-transition);
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}

.bms-input::placeholder,
.bms-textarea::placeholder {
    color: #94a3b8;
}

.bms-input:focus,
.bms-textarea:focus {
    outline: none;
    border-color: var(--bms-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Acciones de gestión */
.bms-acciones-gestionar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.bms-acciones-derecha {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bms-contador {
    font-size: 0.85rem;
    color: var(--bms-text-muted);
    font-weight: 600;
    background: var(--bms-bg);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--bms-border);
}

/* Feedback de guardado */
.bms-guardar-feedback {
    margin-top: 16px;
    padding: 0;
    border-radius: var(--bms-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.bms-guardar-feedback.bms-success {
    max-height: 80px;
    padding: 12px 16px;
    background: #f0fdf4;
    color: var(--bms-success);
    border: 1px solid #bbf7d0;
}

.bms-guardar-feedback.bms-error {
    max-height: 80px;
    padding: 12px 16px;
    background: #fef2f2;
    color: var(--bms-danger);
    border: 1px solid #fecaca;
}

/* Mensaje feedback en la vista */
.bms-mensaje-feedback {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0;
    border-radius: var(--bms-radius-sm);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.bms-mensaje-feedback.bms-success {
    max-height: 60px;
    padding: 10px 14px;
    background: #f0fdf4;
    color: var(--bms-success);
    border: 1px solid #bbf7d0;
}

.bms-mensaje-feedback.bms-error {
    max-height: 60px;
    padding: 10px 14px;
    background: #fef2f2;
    color: var(--bms-danger);
    border: 1px solid #fecaca;
}

/* Estado de carga */
.bms-cargando {
    opacity: 0.6;
    pointer-events: none;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .bms-perfil-principal {
        padding: 20px;
    }

    .bms-perfil-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bms-servicios-grid {
        grid-template-columns: 1fr;
    }

    .bms-acciones-gestionar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bms-acciones-derecha {
        width: 100%;
        justify-content: space-between;
    }

    .bms-tab-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .bms-perfil-header-right {
        width: 100%;
    }

    .bms-btn-primary,
    .bms-btn-mensaje {
        width: 100%;
        justify-content: center;
    }
}
