/**
 * Real Leaf B2B Plugin — Frontend Styles
 * Version: 1.0.0
 *
 * Waldgruen Color Scheme:
 *   Primary:  #2D5A27
 *   Light:    #4A8A42
 *   Dark:     #1a3d17
 *   Accent:   #e8f5e6
 */

/* ==========================================================================
   1. Registration — Group Selection
   ========================================================================== */

.rl-b2b-group-selection {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 2px solid #e8f5e6;
    border-radius: 8px;
    background: #fafff9;
}

.rl-b2b-group-selection h4 {
    color: #2D5A27;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.rl-b2b-group-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rl-b2b-group-card {
    flex: 1 1 200px;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    background: #fff;
    text-align: center;
}

.rl-b2b-group-card:hover {
    border-color: #4A8A42;
    box-shadow: 0 2px 8px rgba(45, 90, 39, 0.15);
    transform: translateY(-1px);
}

.rl-b2b-group-card.active,
.rl-b2b-group-card.selected {
    border-color: #2D5A27;
    background: #e8f5e6;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.2);
}

.rl-b2b-group-card .group-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.rl-b2b-group-card .group-desc {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.rl-b2b-group-card .group-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 12px;
    background: #fff3cd;
    color: #856404;
}

.rl-b2b-group-notice {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    border-left: 3px solid #2D5A27;
    background: #e8f5e6;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
}

/* ==========================================================================
   2. Approval Notice
   ========================================================================== */

.rl-b2b-approval-notice {
    border-left: 4px solid;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.rl-b2b-approval-notice.status-pending {
    border-left-color: #ffc107;
    background: #fff8e1;
}

.rl-b2b-approval-notice.status-blocked {
    border-left-color: #dc3545;
    background: #fce4e4;
}

.rl-b2b-approval-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.rl-b2b-approval-step {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #aaa;
}

.rl-b2b-approval-step.active {
    color: #2D5A27;
    font-weight: 600;
}

.rl-b2b-approval-step.completed {
    color: #4A8A42;
}

.rl-b2b-approval-step-divider {
    width: 30px;
    height: 2px;
    background: #ddd;
}

.rl-b2b-approval-step.completed + .rl-b2b-approval-step-divider {
    background: #4A8A42;
}

/* ==========================================================================
   3. Price Comparison (Haendlerpreis-Vergleich)
   ========================================================================== */

.rl-b2b-compare {
    margin-top: 0.25rem;
}

.rl-b2b-retail-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85em;
}

.rl-b2b-retail-label {
    font-size: 0.75em;
    color: #999;
}

.rl-b2b-your-price {
    font-weight: 700;
    color: #2D5A27;
}

.rl-b2b-your-label {
    font-size: 0.75em;
    color: #2D5A27;
}

.rl-b2b-savings {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    background: #2D5A27;
    color: #fff;
    margin-left: 0;
    margin-top: 0.35rem;
}

.rl-b2b-badge-sm {
    font-size: 0.72rem;
    padding: 1px 7px;
    background: #b42318;
    color: #fff;
    border-radius: 3px;
}

.rl-b2b-compare-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-bottom: 0.2rem;
    text-align: center;
}

.rl-b2b-retail-strike {
    font-size: 0.9rem;
    color: #8b8b8b;
}

.rl-b2b-your-label--list {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2D5A27;
}

.price-note .vat_info {
    display: block;
}

.price-note .rl-b2b-savings {
    margin-top: 0.45rem;
}

/* Product list compact mode */
.product-wrapper .rl-b2b-compare {
    font-size: 0.85em;
}

@media (max-width: 767.98px) {
    .price-note .rl-b2b-savings {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   4. Login-for-Prices Hint
   ========================================================================== */

.rl-b2b-login-hint {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    border-radius: 4px;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

.rl-b2b-login-hint a {
    color: #2D5A27;
    font-weight: 600;
    text-decoration: underline;
}

/* ==========================================================================
   5. Magic Link Welcome
   ========================================================================== */

.rl-b2b-magic-welcome {
    border-left: 4px solid #2D5A27;
    background: #e8f5e6;
    animation: rl-b2b-fadeIn 0.5s ease-out;
}

@keyframes rl-b2b-fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rl-b2b-magiclink-page .rl-b2b-cat-card {
    border: 2px solid #e8f5e6;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #333;
}

.rl-b2b-magiclink-page .rl-b2b-cat-card:hover {
    border-color: #2D5A27;
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.15);
}

/* ==========================================================================
   6. Quick Order
   ========================================================================== */

.rl-b2b-quickorder-page h1 {
    color: #2D5A27;
    margin-bottom: 1.5rem;
}

.rl-b2b-quickorder-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #2D5A27;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rl-b2b-qo-row .rl-b2b-qo-result.found {
    color: #2D5A27;
    font-weight: 500;
}

.rl-b2b-qo-row .rl-b2b-qo-result.not-found {
    color: #dc3545;
}

.rl-b2b-quickorder-results .alert-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   7. Order Templates
   ========================================================================== */

.rl-b2b-template-card .card-header {
    background: #f8f9fa;
    border-bottom: 2px solid #e8f5e6;
}

.rl-b2b-template-card .table {
    font-size: 0.9rem;
}

.rl-b2b-template-card .table code {
    background: #e8f5e6;
    padding: 1px 4px;
    border-radius: 3px;
    color: #2D5A27;
    font-size: 0.85em;
}

/* ==========================================================================
   8. File Upload
   ========================================================================== */

.rl-b2b-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
}

.rl-b2b-upload-zone:hover,
.rl-b2b-upload-zone.dragover {
    border-color: #2D5A27;
    background: #e8f5e6;
}

.rl-b2b-upload-zone .upload-icon {
    font-size: 2rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.rl-b2b-upload-zone.dragover .upload-icon {
    color: #2D5A27;
}

.rl-b2b-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.rl-b2b-upload-preview .preview-item {
    padding: 0.25rem 0.75rem;
    background: #e8f5e6;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   9. Code Input
   ========================================================================== */

.rl-b2b-code-input {
    position: relative;
}

.rl-b2b-code-input .code-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 0.9rem;
}

.rl-b2b-code-input .code-toggle:hover {
    color: #2D5A27;
}

/* ==========================================================================
   10. Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .rl-b2b-group-cards {
        flex-direction: column;
    }

    .rl-b2b-group-card {
        flex: 1 1 100%;
    }

    .rl-b2b-quickorder-table .d-none-mobile {
        display: none;
    }

    .rl-b2b-approval-steps {
        flex-direction: column;
        align-items: flex-start;
    }

    .rl-b2b-approval-step-divider {
        width: 2px;
        height: 20px;
        margin-left: 10px;
    }
}
