/**
 * B2B Sales Kit Public Styles
 */

/* CSS Custom Properties for Theme Integration */
:root {
    --b2bsk-primary-bg: rgba(0, 115, 170, 0.08);
    --b2bsk-primary-text: #2c3e50;
    --b2bsk-primary-border: rgba(0, 115, 170, 0.2);
    --b2bsk-primary-hover-bg: rgba(0, 115, 170, 0.12);
    --b2bsk-primary-hover-border: rgba(0, 115, 170, 0.3);
    --b2bsk-border-radius: 0.25rem;
    --b2bsk-font-family: inherit;
}

/* B2B User Styles */
.b2bsk-b2b-user .b2bsk-shop-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #004085;
}

.b2bsk-shop-notice p {
    margin: 0;
    font-weight: 500;
}

/* Product Group Info - Theme Agnostic */
.b2bsk-product-group-info {
    margin: 0.5rem 0 1rem 0;
    text-align: left;
    clear: both;
    width: 100%;
}

.b2bsk-group-badge {
    display: inline-flex;
    align-items: center;
    background: var(--b2bsk-primary-bg, rgba(0, 0, 0, 0.05));
    color: var(--b2bsk-primary-text, inherit);
    border: 1px solid var(--b2bsk-primary-border, rgba(0, 0, 0, 0.1));
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.b2bsk-group-badge::before {
    content: "\1F465";
    margin-right: 0.375rem;
    opacity: 0.7;
    font-size: 0.75em;
}

/* Theme Integration */
.b2bsk-group-badge:hover {
    background: var(--b2bsk-primary-hover-bg, rgba(0, 0, 0, 0.08));
    border-color: var(--b2bsk-primary-hover-border, rgba(0, 0, 0, 0.15));
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .b2bsk-group-badge {
        border-width: 2px;
        font-weight: 600;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .b2bsk-group-badge {
        transition: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .b2bsk-product-group-info {
        margin-bottom: 0.75rem;
    }
    
    .b2bsk-group-badge {
        font-size: 0.8125rem;
        padding: 0.1875rem 0.625rem;
    }
}

/* Account Info Styles */
.b2bsk-account-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.b2bsk-account-info p {
    margin: 0 0 8px 0;
    color: #495057;
}

.b2bsk-account-info p:last-child {
    margin-bottom: 0;
}

.b2bsk-group-info strong,
.b2bsk-account-type strong {
    color: #0073aa;
}

/* Price Hidden Styles */
.b2bsk-price-hidden {
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

/* Dashboard Styles */
.b2bsk-dashboard {
    background: #fff;
    border-radius: 4px;
}

.b2bsk-dashboard h2 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.b2bsk-dashboard a.button,
.b2bsk-dashboard button {
    min-width: auto;
}
.b2bsk-dashboard-sidebar a.button,
.b2bsk-dashboard-sidebar button {
    margin-left: 0 !important;
}

/* My Account Navigation Enhancements */
.woocommerce-MyAccount-navigation ul li.b2b-dashboard > a::before,
.woocommerce-MyAccount-navigation ul li.subaccounts > a::before,
.woocommerce-MyAccount-navigation ul li.quotes > a::before {
    font-family: 'dashicons';
    margin-right: 8px;
}

.woocommerce-MyAccount-navigation ul li.b2b-dashboard > a::before {
    content: '\f239'; /* dashboard icon */
}

.woocommerce-MyAccount-navigation ul li.subaccounts > a::before {
    content: '\f307'; /* groups icon */
}

.woocommerce-MyAccount-navigation ul li.quotes > a::before {
    content: '\f123'; /* list-view icon */
}


/* B2B Specific Buttons */
.b2bsk-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.b2bsk-button:hover {
    background: #005a87;
    color: #fff;
}

.b2bsk-button:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.b2bsk-button.secondary {
    background: #6c757d;
}

.b2bsk-button.secondary:hover {
    background: #5a6268;
}

.b2bsk-button.success {
    background: #28a745;
}

.b2bsk-button.success:hover {
    background: #218838;
}

.b2bsk-button.danger {
    background: #dc3545;
}

.b2bsk-button.danger:hover {
    background: #c82333;
}

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

.b2bsk-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: b2bsk-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .b2bsk-shop-notice {
        padding: 10px;
        font-size: 14px;
    }
    
    .b2bsk-account-info {
        padding: 10px;
    }
    
    .b2bsk-dashboard {
        padding: 15px;
    }
    
    .b2bsk-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .b2bsk-shop-notice,
    .b2bsk-account-info {
        display: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .b2bsk-group-badge {
        border: 2px solid currentColor;
    }
    
    .b2bsk-price-hidden {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .b2bsk-loading::after {
        animation: none;
    }
    
    .b2bsk-button {
        transition: none;
    }
}

/* Guest to Account Conversion Styles */
.b2bsk-checkout-conversion {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
}

.b2bsk-conversion-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.b2bsk-conversion-checkbox input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.b2bsk-conversion-incentive {
    margin: 10px 0 0 0;
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.b2bsk-conversion-notice {
    margin: 20px 0;
    padding: 20px;
    background: #e8f4fd;
    border: 1px solid #0073aa;
    border-radius: 4px;
}

.b2bsk-conversion-notice h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0073aa;
    font-size: 1.2em;
}

.b2bsk-conversion-notice p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.b2bsk-conversion-notice .b2bsk-conversion-incentive {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 20px;
}

.b2bsk-conversion-notice .button {
    margin-right: 10px;
    margin-bottom: 10px;
}

#b2bsk-conversion-status {
    margin-top: 15px;
}

#b2bsk-conversion-status.error p {
    margin: 0;
    padding: 10px;
    border-radius: 3px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#b2bsk-conversion-status.success p {
    margin: 0;
    padding: 10px;
    border-radius: 3px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Mobile Responsive for Conversion */
@media (max-width: 768px) {
    .b2bsk-checkout-conversion,
    .b2bsk-conversion-notice {
        padding: 12px;
    }
    
    .b2bsk-conversion-notice .button {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: center;
    }
}