/* Variables for easy customization */
:root {
    --primary-color: #007bff; /* Blue for brand identity */
    --secondary-color: #dc3545; /* Red for emergency/accent */
    --dark-color: #343a40; /* Dark grey for text/backgrounds */
    --light-color: #f8f9fa; /* Light grey for sections */
    --white-color: #ffffff;
    --text-color: #495057;
    --heading-color: #212529;

    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Roboto', sans-serif;

    --max-width: 1200px;
    --section-padding: 80px 0;
    --border-radius: 8px;
    --transition-speed: 0.3s ease-in-out;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--dark-color);
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-primary);
    color: var(--heading-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.4rem; }

.text-white { color: var(--white-color); }
.bg-dark { background-color: var(--dark-color); }
.bg-light { background-color: var(--light-color); }

.section-padding {
    padding: var(--section-padding);
}

.section-description {
    font-size: 1.15rem;
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed), transform 0.2s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    color: var(--white-color);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--white-color);
    color: var(--white-color);
}

.btn-secondary:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}

.btn-cta {
    background-color: var(--secondary-color);
    color: var(--white-color);
    font-size: 1.1rem;
    padding: 16px 32px;
}

.btn-cta:hover {
    background-color: #bd212f;
    color: var(--white-color);
}

.btn-emergency {
    background-color: var(--secondary-color);
    color: var(--white-color);
    font-size: 1rem;
    padding: 10px 20px;
}

.btn-emergency:hover {
    background-color: #bd212f;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.2rem;
}

/* Header */
.main-header {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

.main-header.sticky {
    background-color: rgba(52, 58, 64, 0.95); /* Slightly transparent when sticky */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--white-color);
}

.logo span {
    color: var(--primary-color);
}

.main-nav .nav-list {
    display: flex;
    align-items: center;
}

.main-nav .nav-list li {
    margin-left: 25px;
}

.main-nav .nav-list li a {
    color: var(--white-color);
    font-weight: 600;
    font-size: 1rem;
    transition: color var(--transition-speed);
}

.main-nav .nav-list li a:hover {
    color: var(--primary-color);
}

.main-nav .nav-list li .btn {
    margin-left: 10px;
}

.hamburger-menu {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: url('https://via.placeholder.com/1920x800/007bff/ffffff?text=Plumbing+Hero+Image') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 200px 0 150px;
    position: relative;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Dark overlay */
    z-index: -1;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 20px;
    color: var(--white-color);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons .btn {
    margin: 0 10px;
}

/* Emergency Alert */
.emergency-alert {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 15px 0;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 70px; /* Adjust based on header height */
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.emergency-alert a {
    color: var(--white-color);
    text-decoration: underline;
    margin-left: 5px;
}

.emergency-alert i {
    margin-right: 10px;
}

/* Services Section */
#services h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-item {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.service-item i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-item h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.service-item p {
    margin-bottom: 20px;
}

.service-item .read-more {
    font-weight: 600;
    color: var(--primary-color);
}

.service-item .read-more:hover {
    color: var(--dark-color);
}

/* About Us Section */
.about-content-flex {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.about-image, .about-text {
    flex: 1;
    min-width: 300px; /* Allow wrapping on smaller screens */
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.about-text h2 {
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
}

.about-text ul {
    margin-top: 20px;
    padding-left: 0;
}

.about-text ul li {
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--heading-color);
}

.about-text ul li i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* Why Choose Us Section */
#why-us {
    text-align: center;
    background-color: var(--dark-color);
    color: var(--white-color);
}

#why-us h2 {
    color: var(--white-color);
    margin-bottom: 3rem;
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.reason-item {
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.08); /* Semi-transparent background */
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed);
}

.reason-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.reason-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.reason-item h3 {
    color: var(--white-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.reason-item p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Testimonials Section */
#testimonials {
    text-align: center;
}

#testimonials h2 {
    margin-bottom: 3rem;
}

.testimonial-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    padding: 20px;
}

.testimonial-item {
    display: none; /* Hidden by default, JS will show 'active' */
    animation: fadeIn 1s forwards;
    background-color: var(--light-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.testimonial-item.active {
    display: block;
}

.testimonial-item p {
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

.testimonial-item h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.testimonial-item span {
    font-size: 0.9rem;
    color: var(--text-color);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 10px;
}

.carousel-nav button {
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white-color);
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color var(--transition-speed);
}

.carousel-nav button:hover {
    background-color: var(--primary-color);
}

/* Gallery Section */
#gallery h2, #gallery .section-description {
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-speed);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 123, 255, 0.7); /* Primary color overlay */
    color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://via.placeholder.com/1920x400/343a40/ffffff?text=CTA+Background') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 80px 0;
}

.cta-banner h2 {
    font-size: 3rem;
    color: var(--white-color);
    margin-bottom: 20px;
}

.cta-banner p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* FAQ Section (Accordion) */
#faq {
    text-align: center;
}

#faq h2 {
    margin-bottom: 3rem;
}

.accordion-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.accordion-item {
    background-color: var(--white-color);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.accordion-header {
    width: 100%;
    background-color: var(--light-color);
    padding: 20px 25px;
    border: none;
    text-align: left;
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--heading-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition-speed);
}

.accordion-header:hover {
    background-color: #e2e6ea;
}

.accordion-icon {
    transition: transform var(--transition-speed);
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed), padding var(--transition-speed);
    background-color: var(--white-color);
}

.accordion-content p {
    padding-bottom: 20px;
    padding-top: 10px;
    margin-bottom: 0;
}

/* Contact Section */
#contact {
    text-align: center;
}

#contact h2 {
    color: var(--white-color);
    margin-bottom: 3rem;
}

#contact .section-description {
    color: rgba(255, 255, 255, 0.8);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    text-align: left;
    margin-top: 40px;
}

.contact-info h3, .contact-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
}

.contact-info p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.contact-info p i {
    margin-right: 15px;
    color: var(--secondary-color);
}

.contact-info a {
    color: var(--white-color);
}

.contact-info a:hover {
    color: var(--primary-color);
}

.social-links {
    margin-top: 30px;
}

.social-links a {
    color: var(--white-color);
    font-size: 1.5rem;
    margin-right: 20px;
    transition: color var(--transition-speed);
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Contact Form */
.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--white-color);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #6c757d;
    border-radius: var(--border-radius);
    background-color: #495057;
    color: var(--white-color);
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.contact-form select option {
    background-color: var(--dark-color); /* Ensure options are readable */
    color: var(--white-color);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: auto;
    margin-top: 15px;
}

.error-message {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: 5px;
    display: none; /* Hidden by default, shown with JS */
}

.form-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 600;
    display: none; /* Hidden by default */
}

.form-status.success {
    background-color: #28a745;
    color: var(--white-color);
}

.form-status.error {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

/* Map Placeholder */
.map-placeholder {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* Footer */
.main-footer {
    background-color: #212529;
    color: rgba(255, 255, 255, 0.7);
    padding-top: 60px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
    font-size: 1.4rem;
    color: var(--white-color);
    margin-bottom: 25px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.footer-col.about-company .logo {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--white-color);
}

.footer-col.about-company .logo span {
    color: var(--primary-color);
}

.footer-col ul {
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-col.contact-info-footer p {
    margin-bottom: 10px;
}

.footer-col.contact-info-footer i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-col.contact-info-footer a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
    padding: 25px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin-bottom: 5px;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 5px;
}

.footer-bottom a:hover {
    color: var(--primary-color);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed), transform 0.2s ease;
    z-index: 998;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

.back-to-top-btn:hover {
    background-color: #0056b3;
    transform: translateY(-8px);
}

/* Scroll Reveal Animations (Optional but adds power) */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav .nav-list {
        display: none; /* Hide desktop nav */
        flex-direction: column;
        position: absolute;
        top: 70px; /* Below header */
        left: 0;
        width: 100%;
        background-color: var(--dark-color);
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        z-index: 990;
        padding: 20px 0;
    }

    .main-nav .nav-list.active {
        display: flex;
    }

    .main-nav .nav-list li {
        margin: 10px 0;
        text-align: center;
        width: 100%;
    }

    .main-nav .nav-list li a {
        padding: 10px 0;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav .nav-list li:last-child a {
        border-bottom: none;
    }

    .main-nav .nav-list li .btn {
        margin-left: 0;
        margin-top: 10px;
        width: 80%;
    }

    .hamburger-menu {
        display: block;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 20px;
    }

    .hero-buttons .btn {
        width: 80%;
        margin: 0 auto;
    }

    .emergency-alert {
        top: 60px; /* Adjust for smaller header */
    }

    .about-content-flex {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        order: 1;
    }

    .about-text {
        order: 2;
    }

    .about-text ul {
        text-align: left; /* Keep list left-aligned */
        padding-left: 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form-container, .contact-info {
        text-align: center;
    }

    .contact-form label, .contact-form input, .contact-form select, .contact-form textarea {
        text-align: left; /* Keep form elements left-aligned */
    }

    .social-links {
        justify-content: center;
        display: flex;
    }

    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        text-align: center;
    }

    .footer-col h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero {
        padding: 150px 0 100px;
    }

    .section-padding {
        padding: 60px 0;
    }

    .service-grid, .why-us-grid, .gallery-grid {
        grid-template-columns: 1fr;
    }

    .main-header {
        padding: 10px 0;
    }

    .emergency-alert {
        top: 50px; /* Adjust again */
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .btn-lg { padding: 14px 28px; font-size: 1.1rem; }

    .testimonial-item {
        padding: 25px;
    }

    .carousel-nav button {
        padding: 8px 12px;
        font-size: 1rem;
    }
}

/* Keyframe for fadeIn animation (used in testimonials) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}