/* B2B Warehouse Manager Frontend Styles */

.b2b-warehouse-selection,
.b2b-po-number,
.b2b-special-instructions,
.b2b-tax-exemption-section {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.b2b-warehouse-selection h3,
.b2b-po-number h3,
.b2b-special-instructions h3,
.b2b-tax-exemption-section h3 {
    margin-top: 0;
    color: #333;
}

.b2b-status-notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.b2b-status-notice.approved {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.b2b-status-notice.pending {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.b2b-dashboard {
    max-width: 800px;
}

.b2b-customer-info,
.b2b-quick-actions {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.b2b-info-table {
    width: 100%;
    border-collapse: collapse;
}

.b2b-info-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.b2b-info-table td:first-child {
    width: 150px;
    font-weight: bold;
}

.b2b-exemptions-table,
.b2b-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.b2b-exemptions-table th,
.b2b-exemptions-table td,
.b2b-orders-table th,
.b2b-orders-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.b2b-exemptions-table th,
.b2b-orders-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.status-active {
    color: #155724;
    font-weight: bold;
}

.status-inactive {
    color: #721c24;
    font-weight: bold;
}

.status-approved {
    color: #155724;
    font-weight: bold;
}

.status-pending {
    color: #856404;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.b2b-add-exemption {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.b2b-add-exemption h3 {
    margin-top: 0;
}

.b2b-add-exemption p {
    margin: 15px 0;
}

.b2b-add-exemption label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.b2b-add-exemption input,
.b2b-add-exemption select,
.b2b-add-exemption textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.b2b-add-exemption .required {
    color: #dc3545;
}

.b2b-exemptions-list {
    margin-top: 30px;
}

.b2b-warehouse-orders {
    max-width: 100%;
    overflow-x: auto;
}

.b2b-orders-table a {
    color: #0073aa;
    text-decoration: none;
}

.b2b-orders-table a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .b2b-warehouse-selection,
    .b2b-po-number,
    .b2b-special-instructions,
    .b2b-tax-exemption-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .b2b-exemptions-table,
    .b2b-orders-table {
        font-size: 14px;
    }
    
    .b2b-exemptions-table th,
    .b2b-exemptions-table td,
    .b2b-orders-table th,
    .b2b-orders-table td {
        padding: 8px 5px;
    }
    
    .b2b-add-exemption input,
    .b2b-add-exemption select,
    .b2b-add-exemption textarea {
        max-width: 100%;
    }
    
    /* Mobile checkout - Address type selector */
    .b2b-address-type-selector .woocommerce-input-wrapper {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .b2b-address-type-selector .b2b-radio-option-wrapper {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    
    .b2b-address-type-selector .b2b-radio-option-wrapper label.radio {
        display: block !important;
        width: 100% !important;
        padding: 12px !important;
        text-align: center !important;
    }
    
    /* Mobile checkout - Dropship address form */
    #b2b-add-dropship-address-form {
        padding: 15px !important;
        margin: 15px 0 !important;
    }
    
    #b2b-new-address-fields .form-row {
        margin-bottom: 15px !important;
    }
    
    #b2b-new-address-fields input[type="text"],
    #b2b-new-address-fields input[type="email"],
    #b2b-new-address-fields select {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Mobile checkout - Select dropdown */
    .b2b-dropship-address-select select,
    select[name="b2b_dropship_address_id"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .b2b-address-type-selector .b2b-radio-option-wrapper label.radio {
        font-size: 14px !important;
        padding: 10px !important;
    }
    
    #b2b-add-dropship-address-form h4 {
        font-size: 16px !important;
    }
    
    .b2b-notice {
        max-width: calc(100% - 40px) !important;
        left: 20px !important;
        right: 20px !important;
    }
}

/* Form Styling */
#b2b-registration-fields {
    background: #f9f9f9;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#b2b-registration-fields p {
    margin: 10px 0;
}

#b2b-registration-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#b2b-registration-fields input {
    width: 100%;
    max-width: 400px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.required {
    color: #dc3545;
}

/* Button Styling */
.b2b-quick-actions .button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Loading States */
.b2b-loading {
    opacity: 0.6;
    pointer-events: none;
}

.b2b-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: b2b-spin 1s linear infinite;
}

@keyframes b2b-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.b2b-carrier-account-fields {
    display: block !important;
    clear: both;
    float: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    margin: 10px 0 6px 0;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    white-space: normal;
}

.b2b-carrier-account-fields label {
    display: block !important;
    margin-bottom: 4px;
    font-weight: 600;
}

.b2b-carrier-account-fields select,
.b2b-carrier-account-fields input.input-text {
    display: block !important;
    width: 100%;
    max-width: 320px;
    margin-bottom: 4px;
    visibility: visible !important;
}

.b2b-carrier-account-fields small {
    display: block;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.woocommerce ul#shipping_method li {
    overflow: visible;
}

.woocommerce ul#shipping_method li .b2b-carrier-account-fields {
    font-weight: normal;
    margin-top: 10px;
}

.woocommerce-cart .cart_totals .shipping,
.woocommerce-cart .cart_totals .woocommerce-shipping-totals {
    display: table-row !important;
}

.woocommerce-cart ul#shipping_method li .b2b-carrier-account-fields {
    margin-left: 0;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tr.b2b-carrier-account-row th,
.woocommerce-cart .cart_totals tr.b2b-carrier-account-row th {
    vertical-align: top;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tr.b2b-carrier-account-row td,
.woocommerce-cart .cart_totals tr.b2b-carrier-account-row td {
    overflow: visible;
}

#b2b-carrier-account-host,
#b2b-carrier-account-fields-template {
    clear: both;
}


