/* ==========================================
   1. BODY SCROLL LOCK
   ========================================== */
body.modal-open {
    overflow: hidden !important; /* Prevents background site from scrolling */
    height: 100vh;
    padding-right: var(--modal-scrollbar-gap, 0px);
}

/* ==========================================
   2. FOOTER MAIN STYLES
   ========================================== */
.footer {
    background: var(--footer-background, #062940);
    color: var(--footer-text, #fff);
    padding: 20px 10px;
    border-top: 4px solid #ffd166;
    margin-top: 32px;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    text-align: center;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #ffd166;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a, 
.footer-a {
    color: var(--footer-text, #fff);
    text-decoration: none;
    transition: text-decoration 0.3s;
}

.footer-section a:hover {
    text-decoration: underline;
}

/* Gas Safe & Logo Handling */
.gas-safe {
    text-align: center;
}

.gas-safe-logo {
    display: block;
    margin: 0 auto 8px;
    height: 50px;
    object-fit: contain;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-logo {
    height: 80px;
    max-height: 100px;
    margin-bottom: 12px;
    object-fit: contain;
}

/* ==========================================
   3. MODAL OVERLAY & CONTENT BOX
   ========================================== */
.call-modal {
    display: none; /* Controlled by JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;     /* Centers the box vertically */
    justify-content: center;  /* Centers the box horizontally */
    padding: 15px;            /* Gap for mobile edges */
}

.call-modal-content {
    background-color: #fffaf5;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;        /* Keeps box inside screen viewport */
    overflow-y: auto;        /* ENABLES INTERNAL SCROLLING */
    border-radius: 15px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
}

/* ==========================================
   4. MODAL HEADER & BRANDING
   ========================================== */
.call-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-brand-name {
    font-weight: bold;
    color: #062940;
    font-size: 1.2rem;
}

.call-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

/* ==========================================
   5. MODAL TITLES & LEFT ALIGNMENT
   ========================================== */
.modal-title-single {
    display: block;
    text-align: left !important;
    font-size: 1.6rem;
    font-weight: bold;
    color: #062940;
    margin-bottom: 25px;
    position: relative;
    width: 100%;
}

/* Decorative Line - Matching Site Reference */
.modal-title-single::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 140px;
    height: 3px; /* Clean, refined thickness */
    background-color: #2b6777;
}

/* Left Align for all Grey Sub-text (Initial & Thank You states) */
.modal-left-text, 
#modal-thank-you p {
    text-align: left !important;
    color: #666;
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: block;
}

/* ==========================================
   6. CALLBACK FORM & INPUTS
   ========================================== */
#footer-callback-form fieldset {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

#footer-callback-form label {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 15px;
    margin-bottom: 5px;
    color: #333;
}

#footer-callback-form input, 
#footer-callback-form select, 
#footer-callback-form textarea {
    width: 100% !important;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}

.callback-form-status { min-height: 21px; margin: 12px 0 0; color: #166534; font-weight: 700; text-align: left; }
.callback-form-status.error { color: #b42318; }
#callback-submit-button:disabled { opacity: 0.62; cursor: wait; }

/* ==========================================
   7. BUTTONS (Primary & Neutral Grey)
   ========================================== */
.call-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn.primary { background-color: #2b6777; color: white; }
.btn.danger  { background-color: #c84b31; color: white; }

.btn.primary, .btn.danger {
    padding: 14px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

/* Neutral Grey Buttons (Back & Close) */
.btn.secondary, 
.btn.close, 
.modal-close-trigger {
    background-color: #e9e9e9 !important; /* Visible grey */
    color: #333 !important;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
    text-align: center;
}

.btn.secondary:hover, 
.btn.close:hover, 
.modal-close-trigger:hover {
    background-color: #d8d8d8 !important; /* Darker grey on hover */
    color: #000 !important;
}

/* ==========================================
   8. FLOATING BUTTONS & RESPONSIVE
   ========================================== */
.back-to-top {
    --footer-float-offset: 0px;
    position: fixed;
    right: 18px;
    z-index: 1000;
    transition: all 0.4s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    bottom: 18px;
    background: #ff9900;
    color: #fff;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 20px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(var(--footer-float-offset));
}

.back-to-top.show { opacity: 1; pointer-events: auto; }

body.near-footer .back-to-top {
    --footer-float-offset: -64px;
}

.back-to-top img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
}

.accessibility-widget {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 5000;
    transition: transform .3s ease;
}

body.near-footer .accessibility-widget {
    transform: translateY(-64px);
}

.accessibility-toggle {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--highlight-amber, #ffd166);
    border-radius: 50%;
    background: var(--nav-background, #0a2c66);
    color: var(--nav-text, #fff);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.3);
    cursor: pointer;
}

.accessibility-options {
    position: absolute;
    left: 0;
    bottom: 58px;
    width: min(290px, calc(100vw - 36px));
    padding: 14px;
    border: 1px solid var(--frame-neutral, #dbe4ef);
    border-radius: 8px;
    background: var(--tile-background, #fff);
    color: var(--text-primary, #0f1724);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.24);
}

.accessibility-options[hidden] { display: none !important; }
.accessibility-options h3 { margin: 0 0 10px; font-size: 1rem; color: var(--text-primary); }
.theme-choice-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-choice-group button { min-height: 38px; padding: 0 8px; border: 1px solid var(--frame-neutral); border-radius: 5px; background: var(--background-alt); color: var(--text-primary); font: inherit; font-weight: 700; cursor: pointer; }
.theme-choice-group button.is-active { border-color: var(--highlight-amber); background: var(--nav-background); color: var(--nav-text); }
.text-size-slider { margin-top: 14px; }
.text-size-slider label { display: block; margin-bottom: 7px; font-weight: 700; }
.text-size-slider input { width: 100%; }
.analytics-preference { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--frame-neutral, #dbe4ef); }
.analytics-preference label { display: flex; align-items: flex-start; gap: 8px; color: var(--text-primary); font-weight: 700; line-height: 1.35; cursor: pointer; }
.analytics-preference input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--highlight-amber, #f59e0b); }
.analytics-preference p { margin: 7px 0 0 26px; color: var(--text-muted, #657087); font-size: .78rem; line-height: 1.4; }
.analytics-preference a { color: inherit; text-decoration: underline; }

.floating-book-btn:hover, .back-to-top:hover {
    background: #e68a00;
    transform: translateY(calc(var(--footer-float-offset) - 3px));
}

.emergency-call-modal .call-modal-content {
    max-width: 560px;
}

.emergency-modal-content {
    text-align: center;
}

.emergency-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 6px;
}

.emergency-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(200, 75, 49, 0.12);
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.emergency-modal-title {
    text-align: center !important;
    margin-bottom: 6px;
}

.emergency-modal-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.emergency-modal-copy {
    max-width: 420px;
    margin: 0;
    text-align: center !important;
    color: #475467;
}

.emergency-phone-display {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    font-weight: 800;
    color: #0a2c66;
    letter-spacing: 0.02em;
}

.emergency-modal-actions {
    width: 100%;
    max-width: 280px;
    margin: 8px auto 0;
}

.emergency-call-now {
    font-size: 1.05rem;
}


@media (max-width: 768px) {
    .footer-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 20px;
        text-align: center;
    }
    .footer-section { width: 100%; min-width: 0; max-width: none; }
    .footer-section.gas-safe { grid-column: 1 / -1; }
    .footer-logo { height: 60px; }
    .modal-title-single { font-size: 1.3rem; white-space: normal; }
    
    .call-modal-content {
        padding: 20px;
        max-height: 85vh; /* Tighter fit for mobile landscape/small screens */
    }
}

/* Branded Header & Footer */
.feedback-site-header {
    background: #062940;
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 4px solid #ffd166;
}
.header-container h1 { font-size: 1.4rem; margin-top: 10px; }

.feedback-site-footer {
    text-align: center;
    padding: 30px;
    font-size: 0.85rem;
    color: #666;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    margin-top: 50px;
}

/* Fieldset Styling for Ratings */
.rating-fieldset {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    background: #fdfdfd;
}
.rating-fieldset legend {
    font-weight: bold;
    padding: 0 10px;
    color: #2b6777;
    font-size: 1.1rem;
}

/* Review Summary */
.review-summary-box {
    background: #f0f4f7;
    padding: 20px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #d1d9e0;
}
.summary-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e6ed;
    padding-bottom: 8px;
}
.summary-item strong { display: block; font-size: 0.8rem; color: #2b6777; text-transform: uppercase; }
.summary-item span { font-size: 1rem; color: #333; }

/* Success State */
.success-message { text-align: center; padding: 40px 0; }
.success-icon { font-size: 4rem; display: block; margin-bottom: 20px; }

/* General spacing */
.hint { font-size: 0.85rem; color: #777; margin-bottom: 20px; }
.row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media(min-width: 600px) { .row { grid-template-columns: 1fr 1fr; } }
