/* Modal Overlay */
.quotepress-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.quotepress-modal-overlay.active {
    display: flex;
}

/* Modal Content */
.quotepress-modal-content {
    background: #fff;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.quotepress-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quotepress-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.quotepress-close-btn {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

#quotepress-quote-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Modal Body - Split View Layout */
.quotepress-modal-body {
    flex: 1;
    overflow: hidden !important;
    padding: 0;
    background: #f9f9f9;
    display: flex;
    gap: 0;
}

/* Left Column - Form Scrollable */
.quotepress-form-column {
    flex: 1;
    overflow-y: auto;
    height: 100%;
    padding: 30px;
}

.quotepress-category-section {
    margin-bottom: 40px;
}

.quotepress-category-title {
    background-color: #ed1c24;
    /* Red background */
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    /* Extra Bold */
    text-align: center;
    padding: 10px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    display: block;
    width: 100%;
    /* Optional: box shadow or rounded corners if desired, but image looks flat/sharp */
}

.quotepress-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Option Card */
.quotepress-option-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.quotepress-option-card:hover {
    border-color: #bbb;
}

/* Standard Items: Green Border */
.quotepress-option-card.qp-item-standard {
    border-color: #4CAF50;
    border-width: 1px;
}

.quotepress-option-card.qp-item-standard.selected {
    border-color: #2E7D32;
    background-color: #E8F5E9;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

/* Upgrade Items: Blue Border */
.quotepress-option-card.qp-item-upgrade {
    border-color: #2196F3;
    border-width: 1px;
}

.quotepress-option-card.qp-item-upgrade.selected {
    border-color: #1565C0;
    background-color: #E3F2FD;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.quotepress-option-card.selected {
    border-width: 2px;
}

.quotepress-input-wrapper {
    margin-top: 2px;
}

/* Hide default checkbox/radio and custom style could be added here, 
   but for simplicity/robustness we keep standard input or custom css checkbox */
.quotepress-option-card input[type="radio"],
.quotepress-option-card input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}

.quotepress-option-details {
    flex: 1;
}

.quotepress-option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.quotepress-option-label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.3;
}

.quotepress-option-price {
    font-weight: 700;
    font-size: 15px;
    color: #333;
    white-space: nowrap;
    margin-left: 10px;
}

.quotepress-option-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    font-weight: normal;
}

/* Right Sidebar - Fixed/Independent Scroll */
.quotepress-sidebar-column {
    flex: 0 0 350px;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
}

.quotepress-sticky-summary {
    position: relative;
    top: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.quotepress-summary-header {
    font-size: 18px;
    border-bottom: 2px solid #d00;
    /* Red underline like image */
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 700;
    text-transform: uppercase;
}

.quotepress-summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.quotepress-summary-line.upgrades-line {
    color: #0073aa;
    font-weight: 500;
}

.quotepress-summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 20px;
    font-weight: 800;
}

.quotepress-disclaimer-card {
    margin-top: 20px;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.quotepress-disclaimer-card p {
    font-size: 11px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 10px 0;
    font-style: italic;
    text-align: justify;
}

.quotepress-disclaimer-card p:last-child {
    margin-bottom: 0;
}

.quotepress-submit-btn {
    display: block;
    width: 100%;
    background: #d00;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-top: 20px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
}

.quotepress-submit-btn:hover {
    background: #b00;
    color: #fff;
}

/* Secondary Actions */
.quotepress-action-btn {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    color: #555;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.quotepress-action-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

/* Responsive Split Pane & Sticky Footer */
@media (max-width: 900px) {

    /* Increased breakpoint for better tablet support */
    .quotepress-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .quotepress-modal-body {
        flex-direction: column;
        padding: 0;
        overflow: hidden !important;
        /* Keep main container non-scrolling */
    }

    .quotepress-form-column {
        height: auto;
        overflow-y: auto;
        /* Form scrolls independently */
        padding: 15px 15px 100px 15px;
        /* Extra padding bottom for sticky footer clearance */
        margin-bottom: 0;
        flex: 1;
    }

    .quotepress-sidebar-column {
        height: auto;
        overflow-y: visible;
        padding: 12px 15px;
        flex: 0 0 auto;
        width: 100%;
        background: #fff;
        border: none;
        border-top: 1px solid #ddd;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
        position: relative;
        /* Stacks at bottom of flex container naturally */
    }

    .quotepress-sticky-summary {
        position: static;
        top: auto;
        margin: 0;
        border: none;
        box-shadow: none;
        padding: 0;

        /* Flex Horizontal Layout */
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    /* Hide detailed breakdown on mobile to match "Horizontal area" req */
    .quotepress-summary-header,
    .quotepress-summary-line,
    .quotepress-action-btn:not(#quotepress-submit-btn):not(#quotepress-print-btn) {
        display: none !important;
    }

    .quotepress-summary-total {
        margin: 0;
        padding: 0;
        border: none;
        width: auto;
        font-size: 16px;
        flex: 1;
        /* Take available left space */
        /* Fix gap issue - override space-between */
        justify-content: flex-start;
        gap: 8px;
    }

    /* Compact Print/Download Button for Mobile */
    #quotepress-print-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 4px;
        margin: 0;
        font-size: 0;
        /* Hide text */
        background: #f0f0f1;
        border: 1px solid #ccc;
        color: #555;
    }

    #quotepress-print-btn .dashicons {
        font-size: 20px;
        margin: 0 !important;
        width: 20px;
        height: 20px;
    }

    .quotepress-submit-btn {
        margin: 0;
        width: auto;
        padding: 10px 15px;
        font-size: 14px;
        flex: 0 0 auto;
        /* Button size based on text */
    }

    #quotepress-customer-info {
        width: 100%;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 10px;
    }
}

/* Option Group Styling */
.quotepress-option-group {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.quotepress-group-label {
    font-size: 16px;
    font-weight: 800;
    color: #333;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid #d00;
    /* Red accent line to match summary */
    padding-bottom: 8px;
    width: fit-content;
}

.quotepress-group-label::after {
    display: none;
    /* Removed the flex line */
}

/* Modal Content Tweaks */
.quotepress-modal-content {
    background: #fdfdfd;
}

.quotepress-modal-body {
    padding: 25px 30px;
    scroll-behavior: smooth;
}

/* Responsive Grid Adjustments */
@media (max-width: 992px) {
    .quotepress-items-grid {
        grid-template-columns: 1fr;
    }
}

.quotepress-option-card {
    height: 100%;
    /* Ensure cards in grid align */
}

/* Quantity Field Spacing */
.quotepress-quantity-wrapper {
    margin-top: 15px;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}