/* =============================================================
   B2B Access — Estilos CSS del módulo
   Portal B2B Tech + AI Advisor
   ============================================================= */

/* ---- Variables de Color B2B ---- */
:root {
    --b2b-primary:       #1a3a5c;
    --b2b-primary-light: #2563eb;
    --b2b-accent:        #f59e0b;
    --b2b-silver:        #94a3b8;
    --b2b-gold:          #f59e0b;
    --b2b-platinum:      #8b5cf6;
    --b2b-pending:       #f97316;
    --b2b-success:       #10b981;
    --b2b-danger:        #ef4444;
    --b2b-surface:       #f8fafc;
    --b2b-border:        #e2e8f0;
    --b2b-text:          #1e293b;
    --b2b-text-muted:    #64748b;
    --b2b-radius:        12px;
    --b2b-shadow:        0 4px 24px rgba(0,0,0,0.08);
}

/* ---- Precio Oculto: Bloque "B2B Lock" ---- */
.b2b-price-locked {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--b2b-primary-light);
    border-radius: var(--b2b-radius);
    margin: 12px 0;
}

.b2b-price-locked__icon {
    color: var(--b2b-primary);
    opacity: 0.6;
}

.b2b-price-locked__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--b2b-primary);
    margin: 0;
}

.b2b-price-locked__text {
    font-size: 0.85rem;
    color: var(--b2b-text-muted);
    margin: 0;
}

.b2b-price-locked__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ---- Botones B2B ---- */
.btn-b2b-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--b2b-primary);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.btn-b2b-primary:hover {
    background: var(--b2b-primary-light);
    transform: translateY(-1px);
    color: #fff !important;
}

.btn-b2b-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: transparent;
    color: var(--b2b-primary) !important;
    border: 2px solid var(--b2b-primary);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.btn-b2b-pending {
    background: #fff3e0;
    color: var(--b2b-pending) !important;
    border: 2px solid var(--b2b-pending);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.85;
    width: 100%;
}

/* ---- Carrito Bloqueado ---- */
.b2b-cart-blocked {
    margin: 12px 0;
}

.b2b-cart-blocked .btn-block {
    width: 100%;
    justify-content: center;
}

.b2b-cart-blocked__hint {
    font-size: 0.8rem;
    color: var(--b2b-text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ---- Página de Espera (Pending) ---- */
.b2b-pending-page {
    max-width: 680px;
    margin: 48px auto;
    padding: 0 20px;
}

.b2b-status-card {
    text-align: center;
    padding: 48px 40px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--b2b-shadow);
    border: 1px solid var(--b2b-border);
}

.b2b-status-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--b2b-text);
    margin: 16px 0 12px;
}

.b2b-status-card__lead {
    font-size: 1rem;
    color: var(--b2b-text-muted);
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* Pasos del proceso */
.b2b-status-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.b2b-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.b2b-step--done,
.b2b-step--active {
    opacity: 1;
}

.b2b-step__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--b2b-surface);
    border: 2px solid var(--b2b-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.b2b-step--done .b2b-step__icon {
    background: var(--b2b-success);
    border-color: var(--b2b-success);
    color: #fff;
}

.b2b-step--active .b2b-step__icon {
    background: #fff7ed;
    border-color: var(--b2b-pending);
    animation: b2b-pulse 2s ease-in-out infinite;
}

.b2b-step__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--b2b-text-muted);
    text-align: center;
}

.b2b-step--done .b2b-step__label,
.b2b-step--active .b2b-step__label {
    color: var(--b2b-text);
}

.b2b-status-card__contact {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--b2b-border);
    font-size: 0.9rem;
    color: var(--b2b-text-muted);
}

.b2b-status-card__contact a {
    color: var(--b2b-primary-light);
    font-weight: 600;
}

/* Estado rechazado */
.b2b-status-rejected .b2b-status-card__icon {
    font-size: 3rem;
}

.b2b-status-rejected h2 {
    color: var(--b2b-danger);
}

/* ---- Loader Ring ---- */
.b2b-loader-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}

.b2b-loader-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 52px;
    height: 52px;
    margin: 6px;
    border: 5px solid var(--b2b-pending);
    border-radius: 50%;
    animation: b2b-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--b2b-pending) transparent transparent transparent;
}

.b2b-loader-ring div:nth-child(1) { animation-delay: -0.45s; }
.b2b-loader-ring div:nth-child(2) { animation-delay: -0.3s;  }
.b2b-loader-ring div:nth-child(3) { animation-delay: -0.15s; }

/* ---- Badges de Grupo en Listing ---- */
.b2b-badge-silver   { background: var(--b2b-silver);   color: #fff; }
.b2b-badge-gold     { background: var(--b2b-gold);     color: #fff; }
.b2b-badge-platinum { background: var(--b2b-platinum); color: #fff; }

.b2b-group-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ---- Keyframes ---- */
@keyframes b2b-ring {
    0%   { transform: rotate(0deg);   }
    100% { transform: rotate(360deg); }
}

@keyframes b2b-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
    50%       { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .b2b-status-card {
        padding: 32px 20px;
    }
    .b2b-price-locked__actions {
        flex-direction: column;
    }
    .b2b-status-steps {
        gap: 4px;
    }
    .b2b-step {
        min-width: 72px;
    }
}
