/*
 * Popup Modal CSS
 *
 * Styling for the modal that appears when the Book Now button is clicked.
 */

.cpb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Semi‑transparent dark backdrop with a blur effect for a modern glass‑morphism feel */
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.cpb-modal-container {
    /* Slight gradient for depth and a softer feel */
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    /* Reduce border radius to free up some space and achieve a more compact look */
    border-radius: 8px;
    /* Keep the modal wide on small screens but cap its width slightly for better readability */
    width: 95%;
    max-width: 600px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    overflow: hidden;
    border: 1px solid #e9e9e9;
    /* Use flexbox so the body grows and footer stays at the bottom */
    display: flex;
    flex-direction: column;
    /* Increase overall height to show more content on taller screens */
    max-height: 90vh;
}

.cpb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Reduce vertical padding to make the header more compact */
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #f7f8fa;
}

.cpb-modal-header h3 {
    margin: 0;
    /* Slightly smaller font size for a compact heading */
    font-size: 1.2rem;
    font-weight: 600;
}

.cpb-modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}
.cpb-modal-close:hover {
    color: #ff3b30;
}

.cpb-modal-body {
    /* Reduce body padding to show more fields without excessive whitespace */
    padding: 16px;
    /* Let the body expand to fill the available space; it will scroll when content overflows */
    flex: 1 1 auto;
    overflow-y: auto;
}

/* Modal footer containing the checkout button */
.cpb-modal-footer {
    /* Reduce footer padding to allocate more space for the scrollable body */
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: #f7f8fa;
}

/* Reset sticky positioning on the checkout button when placed in the footer */
.cpb-modal-footer .cpb-checkout-button {
    position: relative;
    bottom: auto;
    /* Lift the button slightly above the very bottom edge */
    margin-top: 8px;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* Base package price box */
.cpb-base-price-box {
    font-size: 0.95rem;
    /* Reduce bottom margin to pack items closer together */
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e7ecf1;
}

/* Style for extra fields under add-ons */
.cpb-addon-extra-fields {
    padding-left: 20px;
}
.cpb-addon-extra-fields label {
    display: block;
    font-weight: normal;
    margin-top: 8px;
    margin-bottom: 3px;
    font-size: 0.9rem;
}
.cpb-input-file,
.cpb-input-text {
    display: block;
    width: 100%;
    padding: 5px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cpb-form-group {
    /* Compress vertical spacing between form groups */
    margin-bottom: 10px;
}

.cpb-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    /* Reduce font size to fit more form groups on screen */
    font-size: 0.9rem;
}

.cpb-form-group input[type="checkbox"] {
    margin-right: 5px;
}

/* Ensure textarea spans full width */
.cpb-form-group textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    border: 1px solid #dce3eb;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.95rem;
    line-height: 1.4;
    background: #ffffff;
    transition: border-color 0.2s ease;
}
.cpb-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.cpb-total-price-box {
    font-size: 1.2rem;
}

.cpb-checkout-button {
    background-image: linear-gradient(135deg, #00a2ff, #0073e6);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: sticky;
    bottom: -1px;
    z-index: 10;
    /* Add a subtle shadow and border at the top to separate it from scrollable content */
    box-shadow: 0 -1px 5px rgba(0,0,0,0.08);
    transition: background-color 0.2s ease;
}
.cpb-checkout-button:hover {
    background-image: linear-gradient(135deg, #0085d1, #005db0);
}

/* Styling for the total price inside the checkout button */
.cpb-checkout-button .cpb-checkout-total {
    font-weight: 600;
    margin-left: 6px;
}

/* Style add-ons list */
.cpb-addons-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.cpb-addon-item {
    /* Reduce margin and padding so more add-ons fit on screen */
    margin-bottom: 10px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #eef2f7;
    transition: background-color 0.2s ease;
}
.cpb-addon-item:hover {
    background: #f1f5f9;
}

/* Style the add‑on checkbox for better visibility without altering markup */
.cpb-addon-item input[type="checkbox"] {
    accent-color: #00a2ff;
    width: 18px;
    height: 18px;
    margin-right: 8px;
}
/* Align label text vertically with checkbox */
.cpb-addon-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    /* Slightly smaller font for labels to maximise visible items */
    font-size: 0.95rem;
}

/* Character counter styling */
#cpb-requirements-counter {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
    text-align: right;
}