/* =========================================
   1. BASIC SETUP & FONTS
   ========================================= */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f6f6f6;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   2. HEADER & NAVIGATION (Sticky)
   ========================================= */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 20px 0;
    position: sticky; 
    position: -webkit-sticky; 
    top: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header .logo {
    font-size: 1.5em;
    font-weight: 900;
    color: #1a1a1a;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

header nav li {
    margin-left: 30px;
}

header nav a {
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9em;
}

header nav a:hover {
    color: #000000;
}

/* --- CTA Button --- */
.cta-button {
    background-color: #cef8ff; 
    color: #1a1a1a;
    padding: 12px 24px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
}

.cta-button:hover {
    background-color: #ffd04a;
}

/* =========================================
   3. HERO SECTION (Home Page)
   ========================================= */
.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center; 
    justify-content: center;
    text-align: center;
    color: #ffffff;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; 
    transition: opacity 0.5s ease-in-out; 
}

.slide.active { opacity: 1; }

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none; 
    z-index: 1; 
    pointer-events: none; 
}

.hero-content { position: relative; z-index: 2; }

.hero h1 {
    font-size: 3.5em;
    font-weight: 900;
    margin: 0;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9); 
}

.hero p {
    font-size: 1.3em;
    margin-top: 15px;
    margin-bottom: 30px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.9);
}

.prev-btn, .next-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    border: none;
    background-color: rgba(0,0,0,0.3);
    transition: 0.3s ease;
    z-index: 10;
    border-radius: 3px;
}

.next-btn { right: 0; border-radius: 3px 0 0 3px; }
.prev-btn { left: 0; border-radius: 0 3px 3px 0; }
.prev-btn:hover, .next-btn:hover { background-color: rgba(0,0,0,0.8); }

/* =========================================
   4. SERVICES SECTION
   ========================================= */
.services-summary {
    padding: 60px 0;
    background-color: #f9f9f9;
}

.services-summary h2 {
    text-align: center;
    font-size: 2.5em;
    font-weight: 900;
    margin-bottom: 40px;
}

/* --- UPDATED GRID LAYOUT --- */
.services-grid {
    display: grid;
    /* Changed minmax to 300px to force a 3-column wrap on desktop */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px;
}

.service-box {
    position: relative;
    display: block; 
    height: 300px;
    border-radius: 8px;
    overflow: hidden; 
    text-decoration: none; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.service-box:hover .service-overlay {
    background: rgba(0, 0, 0, 0.75);
}

/* Service Images */
.flooring-bg { background-image: url('images/flooring.jpg'); }
.bathroom-bg { background-image: url('images/bathroom.jpg'); }
.deck-bg { background-image: url('images/deck.jpg'); }
.andmore-bg { background-image: url('images/general.jpg'); }
.drywall-bg { background-image: url('images/drywall.jpg'); }

.service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 1;
    transition: background 0.3s ease;
}

.service-content {
    position: relative;
    z-index: 2; 
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    color: #ffffff;
    text-align: center;
}

.service-content h3 {
    font-size: 1.4em; 
    font-weight: 700;
    color: #efd187; 
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.service-content p {
    font-size: 1em;
    line-height: 1.4;
    margin: 0;
    color: #f0f0f0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* =========================================
   5. UNIFIED PAGE HEADERS (About, Contact, Services)
   ========================================= */
.contact-header {
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/contact-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 20px;
    margin-bottom: 40px;
    border-radius: 4px;
}

.about-header {
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/about-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 20px;
    margin-bottom: 40px;
    border-radius: 4px;
}

.services-header {
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/slide4.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 20px;
    margin-bottom: 40px;
    border-radius: 4px;
}

/* The Blue Frame (Master Style) */
.header-frame {
    background-color: #cef8ff;
    padding: 30px 50px;
    border-radius: 8px;
    border: 3px solid #ffffff; 
    display: inline-block;
    max-width: 800px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Text Inside the Blue Frame */
.header-frame h1, .header-frame h2 {
    color: #1a1a1a !important; 
    font-size: 3em; 
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 10px;
    text-shadow: none;
    line-height: 1.1;
}

.header-frame p {
    color: #a54a39; /* Rust/Red accent */
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
    text-shadow: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-frame .emergency-phone { font-weight: 900; }

/* Specific Adjustment for About Page Frame */
.about-header .header-frame {
    padding: 20px 30px;
    max-width: 650px;
}
.about-header .header-frame h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
}

/* =========================================
   6. FORMS & CONTACT LAYOUTS
   ========================================= */
/* Home Page Contact Grid (Map Left, Form Right) */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch; 
}

/* Large Map Container (Home) */
.map-container {
    height: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    background: #fff;
    padding: 5px; 
}

/* Contact Page Layout (Left Text, Right Widgets) */
.contact-page-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; 
    gap: 50px;
    align-items: start;
}

.contact-widgets-right {
    display: flex;
    flex-direction: column;
    gap: 30px; 
}

.map-container-small {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

/* Form Styles */
.form-container form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row { display: flex; gap: 20px; }

input, textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95em;
    background-color: #ffffff;
    color: #333;
    box-sizing: border-box; 
}

input:focus, textarea:focus {
    outline: none;
    border-color: #f7ff5a; 
}

.submit-btn {
    background-color: #398aa5; 
    color: #ffffff;
    padding: 15px 35px;
    font-size: 1em;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    align-self: flex-start;
    transition: background 0.3s ease;
}

.submit-btn:hover { background-color: #9ae8fc; }

/* =========================================
   7. PAGE CONTENT & ABOUT PAGE LAYOUTS
   ========================================= */
main { padding-top: 40px; }

.page-content {
    padding: 60px 0;
    max-width: 100%; 
    margin: 0 auto;
}

/* Split Layout (Text Left, Image/Form Right) */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 60px;
}

/* Image Cropping for Desktop */
.split-layout img {
    width: 100%;
    height: 400px;      
    object-fit: cover; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* =========================================
   8. TESTIMONIALS & FOOTER
   ========================================= */
.testimonials {
    padding: 80px 20px;
    text-align: center;
}

.testimonials h2 {
    font-size: 2.5em;
    font-weight: 900;
    margin-bottom: 40px;
}

.testimonials blockquote {
    font-size: 1.4em;
    font-weight: 400;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto 20px auto;
    font-style: italic;
}

.testimonials cite {
    font-weight: 700;
    font-style: normal;
    color: #555;
}

footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding-top: 60px;
    font-size: 0.9em;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 50px;
}

.footer-col h3 {
    color: #ffffff;
    text-transform: uppercase;
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 0;
    letter-spacing: 1px;
}

.footer-col p { line-height: 1.8; margin-bottom: 15px; }

.company-name {
    color: #98e1f2;
    font-weight: 700;
    font-size: 1.1em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
    border-bottom: 1px solid #ffffff;
    padding-bottom: 10px;
}

.footer-links li:last-child { border-bottom: none; }

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover { color: #efd187; padding-left: 5px; }

.footer-bottom {
    background-color: #111;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid #222;
}

.footer-bottom p { margin: 0; font-size: 0.85em; color: #ffffff; }

/* =========================================
   9. BEFORE & AFTER SLIDESHOW (Global)
   ========================================= */
.ba-slideshow-container {
    max-width: 800px;
    position: relative;
    margin: 40px auto 60px auto; 
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ba-slide {
    display: none; 
    width: 100%;
}

.ba-slide img {
    width: 100%;
    height: 400px; 
    object-fit: cover;
    display: block;
}

/* The "Before" / "After" Labels */
.ba-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    font-weight: 700;
    border-radius: 4px;
    font-size: 0.9em;
    text-transform: uppercase;
}

/* Navigation Buttons */
.ba-prev, .ba-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.3s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    border: none; 
    border-radius: 4px;
}

.ba-next { right: 10px; }
.ba-prev { left: 10px; }
.ba-prev:hover, .ba-next:hover { background-color: rgba(0,0,0,0.8); }

/* Fade Animation */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

/* =========================================
   10. MOBILE RESPONSIVENESS (Max Width 768px)
   ========================================= */
@media (max-width: 768px) {
    
    /* Compact Header */
    header { padding: 10px 0; }
    header .container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    header .logo { font-size: 1.2em; }

    /* Horizontal Scroll Menu */
    header nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    header nav ul {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        padding: 0 20px;
        gap: 20px;
        margin: 0;
        width: max-content;
    }
    header nav li {
        margin: 0;
        border: none;
        flex-shrink: 0;
    }
    .cta-button { padding: 8px 16px; font-size: 0.75em; }

    /* Hero Section */
    .hero { min-height: 400px; padding: 40px 0; }
    .hero h1 { font-size: 1.8em; }
    .hero-slideshow, .hero-overlay { height: 100%; }

    /* Stack All Grids Vertically */
    .services-grid, 
    .footer-grid, 
    .contact-grid, 
    .contact-page-grid,
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Frames & Headers (Shrink padding and text) */
    .contact-header, .about-header, .services-header { padding: 40px 15px; }
    
    .header-frame {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    .header-frame h1, .header-frame h2 { font-size: 1.8em; }
    .header-frame p { font-size: 1em; }

    /* Fix Image Heights on Mobile */
    .split-layout img {
        height: auto; 
        max-height: 250px; 
    }
    
    /* Before/After Slideshow Mobile Height */
    .ba-slide img {
        height: 250px; 
    }

    /* Forms & Maps */
    .form-row { flex-direction: column; gap: 15px; }
    .map-container { min-height: 300px; }

}