/**
 * Author: Sahariar Sultan Masuk
 * Author URI: https://aboutsahariar.com
 */
.sb-builder-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    color: #333;
    border: 1px solid #e1e1e1;
}

.sb-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
}

.sb-logo img {
    max-height: 40px;
}

.sb-top-actions {
    display: flex;
    gap: 15px;
}

.sb-top-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #555;
}

.sb-top-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    color: #ef4a23; /* Star tech orange-red */
}

.sb-header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
}

.sb-main-title {
    font-size: 20px;
    color: #3749bb; /* Star tech blue */
    margin: 0 0 10px 0;
}

.sb-hide-checkbox {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sb-summary-widgets {
    display: flex;
    gap: 15px;
}

.sb-widget {
    padding: 10px 20px;
    text-align: center;
    border-radius: 4px;
    min-width: 120px;
}

.sb-widget.wattage {
    border: 1px dashed #ef4a23;
}

.sb-widget.wattage .sb-val {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.sb-widget.wattage .sb-lbl {
    font-size: 12px;
    color: #666;
}

.sb-widget.items {
    background: #3749bb;
    color: #fff;
}

.sb-widget.items .sb-val {
    font-size: 18px;
    font-weight: bold;
}

.sb-widget.items .sb-lbl {
    font-size: 12px;
}

.sb-section-title {
    background: #737373;
    color: #fff;
    padding: 8px 20px;
    font-weight: bold;
    font-size: 14px;
}

.sb-component-row {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f1f1;
    gap: 20px;
}

.sb-component-row:last-child {
    border-bottom: none;
}

.sb-icon {
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-icon .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: #3749bb;
}

.sb-details {
    flex-grow: 1;
}

.sb-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.sb-req {
    background: #666;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    margin-left: 5px;
}

.sb-ghost-lines {
    margin-top: 10px;
}

.sb-line {
    height: 10px;
    background: #f1f1f1;
    margin-bottom: 5px;
    width: 60%;
}
.sb-line.short {
    width: 40%;
}

.sb-selected-product {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sb-selected-img img {
    max-width: 50px;
    max-height: 50px;
    object-fit: contain;
}

.sb-selected-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.sb-selected-info .sb-price {
    font-weight: bold;
    color: #ef4a23;
}

.sb-action {
    width: 120px;
    text-align: right;
}

.sb-choose-btn, .sb-change-btn {
    background: #fff;
    border: 2px solid #3749bb;
    color: #3749bb;
    padding: 8px 24px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.sb-choose-btn:hover, .sb-change-btn:hover {
    background: #3749bb;
    color: #fff;
}

.sb-remove-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    margin-left: 10px;
}

.sb-remove-btn:hover {
    color: #ef4a23;
}

.sb-error {
    color: #ef4a23;
    font-size: 12px;
}

/* Modal Styles */
.sb-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.sb-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sb-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.sb-modal-header h3 {
    margin: 0;
    color: #333;
}

.sb-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.sb-close:hover {
    color: #000;
}

#sb-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.sb-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.sb-modal-card {
    border: 1px solid #e1e1e1;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.sb-modal-card-img {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.sb-modal-card-img img {
    max-width: 100%;
    max-height: 100%;
}

.sb-no-image {
    background: #f5f5f5;
    color: #aaa;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sb-modal-card-details {
    flex-grow: 1;
}

.sb-modal-card-details h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.sb-modal-price {
    font-weight: bold;
    color: #ef4a23;
    margin-bottom: 15px;
}

.sb-modal-select-btn {
    background: #3749bb;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.sb-modal-select-btn:hover {
    background: #2a3790;
}

.sb-loader {
    text-align: center;
    padding: 40px;
    color: #666;
}

@media (max-width: 768px) {
    .sb-header-area {
        flex-direction: column;
        gap: 15px;
    }
    .sb-component-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .sb-action {
        width: 100%;
        text-align: left;
    }
}

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

.sb-print-footer {
    display: none;
}

@media print {
    /* Hide unnecessary UI elements */
    header, footer, .sb-top-actions, .sb-hide-checkbox, .sb-action, .sb-modal, #wpadminbar,
    .sb-change-btn, .sb-remove-btn,
    /* Hide chat widgets and other floating elements */
    iframe, #tidio-chat, #zsiq_float, .fb_dialog, .cc-window, [id^="chat"], [class*="chat"], .wa-chat-widget, .whatsapp-me, .fb-customerchat, .fb_reset {
        display: none !important;
    }

    /* Format builder wrapper for print */
    .sb-builder-wrapper {
        border: none !important;
        position: relative; /* For watermark positioning */
        max-width: 100% !important;
    }

    .sb-logo img {
        max-height: 80px !important;
    }

    .sb-component-row {
        page-break-inside: avoid;
    }

    /* Print Footer */
    .sb-print-footer {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
        padding-top: 20px;
        margin-top: 20px;
        border-top: 2px dashed #e1e1e1;
        font-size: 20px;
        font-weight: bold;
        color: #ef4a24;
    }
    .sb-print-total-label {
        color: #333;
    }

    /* Watermark */
    .sb-builder-wrapper::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: url('https://solbattbd.com/wp-content/uploads/2026/05/WhatsApp-Image-2026-05-07-at-12.01.14-AM-1.jpeg');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 300px;
        opacity: 0.15;
        z-index: -1;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}