/*
 * MB Gutter Calculator Stylesheet
 * Version: 1.3.0 (Mobile Responsive Update)
 */

/* --- Base & Reset --- */
* {
    box-sizing: border-box;
}

#gutter-calculator-wrapper {
    background-color: #ffffff;
    margin: 2em auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    width: 100%;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden; /* Ensures child elements respect the border radius */
}


/* --- Header --- */
.calculator-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 15px;
}

.calculator-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.request-booking-btn {
    background: #20b2aa;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.request-booking-btn:hover {
    background: #1a9b94;
    transform: translateY(-2px);
}


/* --- Main Form Layout --- */
.gutter-form {
    display: flex;
    background: #fafafa;
}

.form-main {
    flex: 2; /* Takes up 2/3 of space */
    padding: 30px;
    border-right: 1px solid #e0e0e0;
}

.form-sidebar {
    flex: 1; /* Takes up 1/3 of space */
    padding: 30px;
    background: #ffffff;
}

.form-section {
    margin-bottom: 25px;
}

.form-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-section label.required::after {
    content: " *";
    color: #e74c3c;
}


/* --- Form Inputs & Controls --- */
.form-section select,
.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="tel"],
.form-section input[type="number"],
.form-section textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.form-section select:focus,
.form-section input:focus,
.form-section textarea:focus {
    outline: none;
    border-color: #20b2aa;
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.2);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #20b2aa;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-grid .form-section {
    margin-bottom: 0;
}


/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #20b2aa;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}


/* --- Sidebar Summary --- */
.quote-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    position: sticky; /* Makes it stick on scroll for desktop */
    top: 30px;
}

.quote-summary h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

#quote-price-container {
    margin: 20px 0;
}

.currency {
    font-size: 24px;
    color: #666;
    vertical-align: top;
}

.total-price {
    font-size: 42px;
    font-weight: 700;
    color: #20b2aa;
}

#bespoke-quote-message {
    background: #fff3cd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

#bespoke-quote-message p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

#commercial-contact-message {
    background: #d1ecf1;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

#commercial-contact-message p {
    margin: 0;
    color: #0c5460;
    font-size: 14px;
    line-height: 1.4;
}


/* --- Form Messages (Success/Error) --- */
.form-messages {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: none; /* Hidden by default */
}
.form-messages.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.form-messages.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}


/*
========================================
MOBILE RESPONSIVE STYLES
========================================
*/
@media (max-width: 992px) {
    /* --- On Tablets and smaller devices, stack the form and sidebar --- */
    .gutter-form {
        flex-direction: column;
    }
    .form-main {
        border-right: none;
    }
    .quote-summary {
        position: static; /* Unstick the summary box */
        top: auto;
    }
}

@media (max-width: 768px) {
    /* --- On smaller tablets and phones --- */
    #gutter-calculator-wrapper {
        margin: 1em auto;
        border: none;
        box-shadow: none;
    }
    
    .calculator-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .form-main, .form-sidebar {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr; /* Stack grid items */
    }

    .total-price {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    /* --- On small mobile phones --- */
    .calculator-title {
        font-size: 20px;
    }
    
    .form-main, .form-sidebar {
        padding: 15px;
    }

    .request-booking-btn {
        width: 100%;
        padding: 15px;
    }
}