/* RFQ Floating Widget Styles */
:root {
    --rfq-primary: #2563eb;
    --rfq-primary-hover: #1d4ed8;
    --rfq-danger: #dc2626;
    --rfq-danger-hover: #b91c1c;
    --rfq-text: #1f2937;
    --rfq-text-muted: #6b7280;
    --rfq-border: #e5e7eb;
    --rfq-bg: #ffffff;
    --rfq-bg-secondary: #f9fafb;
    --rfq-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --rfq-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Widget Container - Don't interfere with page layout */
.rfq-widget-container {
    position: relative;
    z-index: 999990;
    pointer-events: none;
}

.rfq-widget-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

/* CRITICAL: Tab-Style Cart Button - RIGHT SIDE ONLY */
.rfq-cart-btn,
#rfq-cart-button,
div#rfq-cart-button,
.rfq-widget-container #rfq-cart-button {
    position: fixed !important;
    top: 50% !important;
    right: 0 !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    background: #f3f7fe !important;
    color: #3b82f6 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 1rem 1rem 1rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    width: auto !important;
    height: 45px !important;
    max-width: none !important;
    max-height: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 45px !important;
    pointer-events: auto !important;
    margin: 0 !important;
    inset: auto 0 auto auto !important;
}

.rfq-cart-btn:hover,
#rfq-cart-button:hover {
    background: #3b82f6 !important;
    transform: translateY(-50%) !important;
    box-shadow: 0 0 0 5px #3b83f65f !important;
    color: #fff !important;
    right: 0 !important;
    left: auto !important;
}

/* Hide cart icon - using badge instead */
.rfq-cart-icon {
    display: none !important;
}

.rfq-cart-count {
    background: #ea4335 !important;
    color: white !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.rfq-cart-text {
    white-space: nowrap !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
}

/* Login Button - COMPLETELY HIDDEN */
.rfq-login-btn,
#rfq-login-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.rfq-login-icon,
.rfq-login-text {
    display: none !important;
}

/* Drawer Styles - Fixed Overlay */
.rfq-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999998 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.rfq-drawer-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    animation: rfqFadeIn 0.3s ease !important;
}

.rfq-drawer-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 28rem !important;
    max-height: 90vh !important;
    background: var(--rfq-bg) !important;
    box-shadow: var(--rfq-shadow-lg) !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 0.5rem !important;
    animation: rfqScaleIn 0.3s ease !important;
}

.rfq-drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--rfq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rfq-drawer-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rfq-text);
}

.rfq-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--rfq-text-muted);
    transition: all 0.2s;
}

.rfq-drawer-close:hover {
    background: var(--rfq-bg-secondary);
    color: var(--rfq-text);
}

.rfq-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.rfq-empty-cart {
    text-align: center;
    color: var(--rfq-text-muted);
    padding: 2rem;
}

.rfq-cart-item {
    background: var(--rfq-bg-secondary);
    border: 1px solid var(--rfq-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.rfq-item-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rfq-item-image {
    width: 4rem;
    height: 4rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: var(--rfq-bg);
}

.rfq-item-info {
    flex: 1;
    min-width: 0;
}

.rfq-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--rfq-text);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rfq-item-sku {
    font-size: 0.75rem;
    color: var(--rfq-text-muted);
    font-family: 'Courier New', monospace;
}

.rfq-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rfq-border);
}

.rfq-qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--rfq-border);
    border-radius: 0.375rem;
    background: var(--rfq-bg);
}

.rfq-qty-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--rfq-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rfq-qty-btn:hover {
    background: var(--rfq-bg-secondary);
}

.rfq-qty-value {
    padding: 0 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 2.5rem;
    text-align: center;
}

.rfq-remove-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--rfq-danger);
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rfq-remove-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.rfq-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--rfq-border);
    background: var(--rfq-bg);
}

.rfq-cart-total {
    font-size: 0.875rem;
    color: var(--rfq-text-muted);
    margin-bottom: 0.75rem;
}

.rfq-cart-total span {
    font-weight: 600;
    color: var(--rfq-text);
}

.rfq-submit-btn {
    width: 100%;
    background: var(--rfq-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.rfq-submit-btn:hover {
    background: var(--rfq-primary-hover);
}

/* Modal Styles - Fixed Overlay */
.rfq-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.rfq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: rfqFadeIn 0.3s ease;
}

.rfq-modal-content {
    position: relative;
    background: var(--rfq-bg);
    border-radius: 0.5rem;
    box-shadow: var(--rfq-shadow-lg);
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: rfqScaleIn 0.3s ease;
}

.rfq-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--rfq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rfq-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rfq-text);
}

.rfq-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--rfq-text-muted);
    transition: all 0.2s;
}

.rfq-modal-close:hover {
    background: var(--rfq-bg-secondary);
    color: var(--rfq-text);
}

.rfq-modal-body {
    padding: 1.5rem;
}

.rfq-form-group {
    margin-bottom: 1rem;
}

.rfq-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--rfq-text);
    margin-bottom: 0.375rem;
}

.rfq-form-group input,
.rfq-form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--rfq-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--rfq-text);
    transition: border-color 0.2s;
    font-family: inherit;
}

.rfq-form-group input:focus,
.rfq-form-group textarea:focus {
    outline: none;
    border-color: var(--rfq-primary);
}

.rfq-form-group textarea {
    resize: vertical;
}

.rfq-error-message {
    background: rgba(220, 38, 38, 0.1);
    color: var(--rfq-danger);
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.rfq-auth-submit {
    width: 100%;
    background: var(--rfq-primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.rfq-auth-submit:hover {
    background: var(--rfq-primary-hover);
}

.rfq-auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rfq-auth-toggle {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--rfq-text-muted);
}

.rfq-auth-toggle-btn {
    background: none;
    border: none;
    color: var(--rfq-primary);
    cursor: pointer;
    font-weight: 500;
    margin-left: 0.25rem;
    text-decoration: underline;
}

.rfq-auth-toggle-btn:hover {
    color: var(--rfq-primary-hover);
}

/* Animations */
@keyframes rfqFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes rfqSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes rfqScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rfqSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Progress Modal */
.rfq-progress-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    transition: opacity 0.3s ease !important;
}

.rfq-progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: rfqFadeIn 0.3s ease;
}

.rfq-progress-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    animation: rfqScaleIn 0.3s ease;
}

.rfq-progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: rfqSpin 1s linear infinite;
}

.rfq-progress-content p {
    color: #1f2937;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

/* Notification toast */
.rfq-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rfq-text);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--rfq-shadow-lg);
    z-index: 10001;
    animation: rfqSlideUp 0.3s ease;
}

@keyframes rfqSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .rfq-drawer-content {
        max-width: 100% !important;
    }
    
    .rfq-modal-content {
        max-width: calc(100% - 2rem);
    }
    
    .rfq-cart-btn,
    #rfq-cart-button {
        font-size: 14px !important;
        padding: 0.75rem 0.75rem 0.75rem 1rem !important;
        min-height: 50px !important;
    }
    
    .rfq-cart-count {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    
    .rfq-cart-text {
        font-size: 14px !important;
    }
}
