/* -- B2B Portal Frontend Styles -- */

.mb2b-portal-wrap,
.mb2b-auth-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mb2b-auth-wrap {
    max-width: 450px;
}

/* -- Portal Header -- */
.mb2b-portal-header {
    margin-bottom: 30px;
}

/* -- Edit Account Panel -- */
.mb2b-edit-account-panel {
    margin-top: 15px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    max-width: 500px;
}
.mb2b-edit-account-panel h3 {
    margin-top: 0;
    margin-bottom: 8px;
}
.mb2b-edit-account-panel label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}
.mb2b-edit-account-panel input[type="text"],
.mb2b-edit-account-panel input[type="email"] {
    width: 100%;
    max-width: 380px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}
.mb2b-edit-account-panel input:disabled {
    background: #e5e7eb;
    color: #6b7280;
}

.mb2b-portal-header h2 {
    margin-bottom: 8px;
}

.mb2b-delivery-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    padding: 10px 15px;
    border-radius: 4px;
    color: #92400e;
    font-weight: 500;
}

/* -- Filter Bar -- */
.mb2b-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.mb2b-filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mb2b-filter-search {
    flex: 2;
    min-width: 260px;
}

.mb2b-filter-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mb2b-filter-search input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.mb2b-filter-category {
    min-width: 200px;
}

.mb2b-filter-category select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mb2b-filter-category select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* -- Forms -- */
.mb2b-form .mb2b-field {
    margin-bottom: 16px;
}

.mb2b-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.mb2b-form input[type="text"],
.mb2b-form input[type="email"],
.mb2b-form input[type="password"],
.mb2b-form input[type="number"],
.mb2b-form textarea,
.mb2b-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mb2b-form input:focus,
.mb2b-form textarea:focus,
.mb2b-form select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* -- Buttons -- */
.mb2b-btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.mb2b-btn-primary {
    background: #2271b1;
    color: #fff;
}

.mb2b-btn-primary:hover {
    background: #135e96;
    color: #fff;
}

.mb2b-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.mb2b-btn-secondary:hover {
    background: #e0e0e1;
    color: #2c3338;
}

/* -- Messages -- */
.mb2b-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.mb2b-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.mb2b-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.mb2b-links {
    margin-top: 15px;
    font-size: 13px;
}

.mb2b-links a {
    color: #2271b1;
}

/* -- Product Grid -- */
.mb2b-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.mb2b-product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.mb2b-product-card.mb2b-hidden {
    display: none;
}

.mb2b-product-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mb2b-product-image {
    text-align: center;
    padding: 10px;
    background: #f9f9f9;
    cursor: pointer;
}

.mb2b-product-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.mb2b-product-info {
    padding: 12px 15px;
}

.mb2b-product-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    line-height: 1.3;
}

.mb2b-view-details {
    display: inline-block;
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
    margin-bottom: 8px;
    cursor: pointer;
}

.mb2b-view-details:hover {
    text-decoration: underline;
    color: #135e96;
}

.mb2b-product-pricing {
    margin-bottom: 8px;
}

.mb2b-rrp {
    color: #999;
    font-size: 13px;
    margin-right: 8px;
}

.mb2b-wholesale {
    color: #065f46;
    font-size: 15px;
}

.mb2b-product-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mb2b-product-qty label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 0;
}

.mb2b-qty {
    width: 70px !important;
    text-align: center;
    padding: 6px 8px !important;
}

.mb2b-choose-qty {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 6px 0 8px 0;
    background: #065f46;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.mb2b-choose-qty:hover {
    background: #047857;
}

.mb2b-product-qty-summary {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.mb2b-product-qty-summary .mb2b-var-total-count {
    font-weight: 700;
}

/* Variations (hidden on card, shown in modal) */
.mb2b-product-variations {
    font-size: 13px;
}

.mb2b-variation-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mb2b-variation-row:last-child {
    border-bottom: none;
}

.mb2b-var-name {
    flex: 1;
    min-width: 0;
}

.mb2b-var-price {
    white-space: nowrap;
}

.mb2b-var-price del {
    color: #999;
    font-size: 12px;
    margin-right: 4px;
}

.mb2b-variation-row .mb2b-qty {
    width: 55px !important;
}

/* -- Order Details -- */
.mb2b-order-details {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    max-width: 500px;
}

.mb2b-order-details h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.mb2b-order-summary {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.mb2b-order-summary p {
    margin: 4px 0;
}

/* -- Product Detail Modal -- */
.mb2b-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.mb2b-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.mb2b-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    z-index: 1;
}

.mb2b-modal-close:hover {
    color: #000;
}

.mb2b-modal-body {
    padding: 30px;
}

.mb2b-modal-image {
    text-align: center;
    margin-bottom: 20px;
}

.mb2b-modal-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 4px;
}

.mb2b-modal-body h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    padding-right: 30px;
}

.mb2b-modal-description {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.mb2b-modal-meta {
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.mb2b-modal-meta span {
    margin-right: 15px;
}

.mb2b-modal-pricing {
    margin-bottom: 20px;
}

.mb2b-modal-pricing .mb2b-rrp {
    font-size: 14px;
}

.mb2b-modal-pricing .mb2b-wholesale {
    font-size: 18px;
}

.mb2b-modal-variations {
    margin-bottom: 20px;
}

.mb2b-modal-variations h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.mb2b-modal-variation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mb2b-modal-variation-row:last-child {
    border-bottom: none;
}

.mb2b-modal-var-name {
    flex: 1;
    font-size: 14px;
    min-width: 0;
}

.mb2b-modal-var-price {
    white-space: nowrap;
    font-size: 14px;
}

.mb2b-modal-var-price del {
    color: #999;
    font-size: 12px;
    margin-right: 4px;
}

.mb2b-modal-qty-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.mb2b-modal-qty-wrap label {
    font-weight: 600;
    font-size: 14px;
}

.mb2b-modal-qty-input {
    width: 70px;
    text-align: center;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.mb2b-modal-qty-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.mb2b-modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* -- Responsive -- */
@media (max-width: 900px) {
    .mb2b-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .mb2b-product-grid {
        grid-template-columns: 1fr;
    }

    .mb2b-filter-bar {
        flex-direction: column;
    }

    .mb2b-filter-search,
    .mb2b-filter-category {
        min-width: 100%;
    }

    .mb2b-modal {
        margin: 10px;
        max-height: 95vh;
    }

    .mb2b-modal-body {
        padding: 20px;
    }
}

/* ── SKU display (Apr 8) ── */
.mb2b-product-sku {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
    margin: 2px 0 6px;
    font-family: Consolas, Monaco, monospace;
}

/* ── Password hint (Apr 8) ── */
.mb2b-hint {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}
