/**
 * Button Builder Frontend CSS
 * Genel buton stilleri
 */

/* Genel Buton Stilleri */
.bb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-image: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.bb-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.bb-button:disabled,
.bb-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Buton Boyutları */
.bb-button-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
}

.bb-button-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
}

.bb-button-md {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
}

.bb-button-lg {
    padding: 16px 32px;
    font-size: 18px;
    border-radius: 6px;
}

.bb-button-xl {
    padding: 20px 40px;
    font-size: 20px;
    border-radius: 8px;
}

/* İkon Stilleri */
.bb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bb-icon-before {
    margin-right: 8px;
}

.bb-icon-after {
    margin-left: 8px;
}

/* Buton Wrapper */
.bb-button-wrapper,
.bb-quote-request-wrapper {
    display: inline-block;
}

/* Button Width */
.bb-button-full-width {
    width: 100%;
    display: block;
}

/* WooCommerce Style Matching */
.bb-quote-request-button.button {
    /* WooCommerce button temel stilleri inherit edilecek */
    font-family: inherit;
    line-height: inherit;
    text-decoration: none;
    display: inline-block;
    position: relative;
    cursor: pointer;
    border: none;
    outline: none;
    vertical-align: middle;
    text-align: center;
    overflow: visible;
    margin: 0;
}

/* WooCommerce Typography */
.bb-woo-typography {
    font-family: inherit;
    font-style: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

/* Theme Typography */
.bb-theme-typography {
    font-family: inherit;
    font-style: inherit;
}

/* Font Size Presets */
.bb-font-small {
    font-size: 12px !important;
}

.bb-font-medium {
    font-size: 14px !important;
}

.bb-font-large {
    font-size: 16px !important;
}

.bb-font-extra-large {
    font-size: 18px !important;
}

/* WooCommerce Button Compatibility */
.bb-quote-request-button.single_add_to_cart_button {
    /* Add-to-cart button ile aynı genişlik ve stil */
    width: 100%;
    box-sizing: border-box;
}

/* Tema uyumluluğu için */
.woocommerce .bb-quote-request-button.button,
.woocommerce-page .bb-quote-request-button.button {
    /* WooCommerce sayfalarında tema stillerini kullan */
    background-color: inherit;
    color: inherit;
    border: inherit;
    border-radius: inherit;
    padding: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

/* Woodmart tema uyumluluğu */
.woodmart-theme .bb-quote-request-button.button {
    border-radius: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Astra tema uyumluluğu */
.ast-theme .bb-quote-request-button.button {
    border-radius: 2px;
    font-weight: 500;
}

/* OceanWP tema uyumluluğu */
.oceanwp-theme .bb-quote-request-button.button {
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Hizalama */
.elementor-align-left .bb-button-wrapper {
    text-align: left;
}

.elementor-align-center .bb-button-wrapper {
    text-align: center;
}

.elementor-align-right .bb-button-wrapper {
    text-align: right;
}

.elementor-align-justify .bb-button {
    width: 100%;
}

/* Test Button */
.bb-test-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.bb-test-button:hover {
    background: #005a87;
}

/* Custom Button Varsayılan Stilleri */
.bb-custom-button {
    background: #007cba;
    color: white;
    border: 1px solid transparent;
}

.bb-custom-button:hover {
    background: #005a87;
    color: white;
}

/* Action Button Stilleri */
.bb-action-button {
    background: #28a745;
    color: white;
    border: 1px solid transparent;
}

.bb-action-button:hover {
    background: #218838;
    color: white;
}

/* Popup Stilleri */
.bb-popup-open {
    overflow: hidden;
}

.bb-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.bb-popup-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: bb-popup-in 0.3s ease-out;
}

@keyframes bb-popup-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.bb-popup-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.bb-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.bb-popup-close {
    position: absolute;
    top: -5px;
    right: -5px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bb-popup-close:hover {
    color: #333;
    background: #f5f5f5;
}

.bb-popup-content {
    line-height: 1.6;
    color: #333;
}

.bb-popup-content h1,
.bb-popup-content h2,
.bb-popup-content h3,
.bb-popup-content h4,
.bb-popup-content h5,
.bb-popup-content h6 {
    margin-top: 0;
    margin-bottom: 15px;
}

.bb-popup-content p {
    margin-bottom: 15px;
}

.bb-popup-content img {
    max-width: 100%;
    height: auto;
}

.bb-popup-close-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.bb-popup-close-btn:hover {
    background: #005a87;
}

/* Click Effect */
.bb-clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Loading State */
.bb-button.bb-loading {
    pointer-events: none;
    opacity: 0.7;
}

.bb-button.bb-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: bb-spin 1s linear infinite;
}

@keyframes bb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .bb-popup-container {
        width: 95%;
        padding: 20px;
        margin: 20px;
        max-height: 90vh;
    }
    
    .bb-button-xl {
        padding: 16px 32px;
        font-size: 18px;
    }
    
    .bb-button-lg {
        padding: 14px 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bb-popup-container {
        width: 100%;
        margin: 10px;
        padding: 15px;
        border-radius: 0;
        max-height: 95vh;
    }
    
    .bb-button-xl,
    .bb-button-lg {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bb-popup-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .bb-popup-header {
        border-bottom-color: #4a5568;
    }
    
    .bb-popup-header h3 {
        color: #e2e8f0;
    }
    
    .bb-popup-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .bb-popup-content {
        color: #e2e8f0;
    }
}

/* Accessibility */
.bb-button:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bb-button,
    .bb-popup-container,
    .bb-popup-close,
    .bb-popup-close-btn {
        transition: none;
    }
    
    .bb-popup-container {
        animation: none;
    }
    
    .bb-clicked {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .bb-popup-overlay {
        display: none !important;
    }
}
/* Cart 
Email Modal Stilleri */
.bb-cart-email-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.bb-cart-email-modal.show {
    display: block !important;
    opacity: 1 !important;
    z-index: 999999 !important;
}

.bb-cart-email-modal.show {
    opacity: 1;
}

.bb-cart-email-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.bb-cart-email-form-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bb-cart-email-form {
    padding: 0;
}

.bb-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.bb-form-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.bb-form-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bb-form-close:hover {
    background: #e9ecef;
    color: #333;
}

.bb-form-body {
    padding: 30px;
}

/* Cart Summary Stilleri */
.bb-cart-summary {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.bb-cart-summary h4 {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.bb-cart-items {
    padding: 20px;
}

.bb-cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bb-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
}

.bb-item-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.bb-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bb-no-image {
    font-size: 48px;
    color: #6c757d;
}

.bb-item-details {
    flex: 1;
    min-width: 0;
}

.bb-item-details h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.bb-item-sku {
    margin: 5px 0;
    font-size: 12px;
    color: #6c757d;
}

.bb-item-variation {
    margin: 5px 0;
    font-size: 14px;
    color: #495057;
}

.bb-item-quantity {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.bb-cart-total {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.bb-cart-totals {
    max-width: 300px;
    margin-left: auto;
}

.bb-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.bb-total-row:last-child {
    border-bottom: none;
}

.bb-total-final {
    font-weight: 600;
    font-size: 16px;
    border-top: 2px solid #007cba;
    padding-top: 12px;
    margin-top: 8px;
}

.bb-cart-info {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.bb-cart-info p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

.bb-cart-info small {
    color: #6c757d;
    font-size: 12px;
}

/* Form Stilleri */
.bb-customer-form {
    background: #fff;
}

.bb-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.bb-form-field {
    flex: 1;
}

.bb-form-field-full {
    flex: 1 1 100%;
}

.bb-form-field label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.bb-form-field .required {
    color: #dc3545;
    margin-left: 2px;
}

.bb-form-field input,
.bb-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.bb-form-field input:focus,
.bb-form-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.bb-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.bb-field-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.bb-field-error {
    display: block;
    margin-top: 5px;
    color: #dc3545;
    font-size: 12px;
}

.bb-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.bb-form-cancel,
.bb-form-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.bb-form-cancel {
    background: #6c757d;
    color: #fff;
}

.bb-form-cancel:hover {
    background: #5a6268;
}

.bb-form-submit {
    background: #007cba;
    color: #fff;
}

.bb-form-submit:hover {
    background: #005a8b;
}

.bb-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bb-submit-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bb-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .bb-cart-email-form-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .bb-form-header,
    .bb-form-body {
        padding: 20px;
    }
    
    .bb-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .bb-cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .bb-item-image {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
    
    .bb-form-actions {
        flex-direction: column;
    }
    
    .bb-form-cancel,
    .bb-form-submit {
        width: 100%;
    }
}

/* Body modal açık durumu */
body.bb-modal-open {
    overflow: hidden;
}