/* Basic Reset & Globals */
:root {
    --primary-color: #005A9C;
    --secondary-color: #2A9FD6;
    --accent-color: #FFC107;
    --text-color: #333;
    --light-gray: #f4f4f4;
    --dark-gray: #222;
    --white: #fff;
    --font-primary: 'Roboto', sans-serif;
    --font-headings: 'Montserrat', sans-serif;
    --container-width: 1100px;
    --section-padding: 60px 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    scroll-behavior: smooth;
    overflow-x: hidden; 
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4 {
    font-family: var(--font-headings);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.8rem; color: var(--white); }
h2 { font-size: 2.2rem; color: var(--primary-color); text-align: center; }
h3 { font-size: 1.5rem; color: var(--primary-color); }
p { margin-bottom: 1rem; }
a { text-decoration: none; color: var(--primary-color); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.section-padding {
    padding: var(--section-padding);
}

.bg-light {
    background-color: var(--light-gray);
}
.bg-dark {
    background-color: var(--primary-color);
    color: var(--white);
}
.bg-dark h2, .bg-dark p {
    color: var(--white);
}
.bg-dark a {
    color: var(--accent-color);
}


.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--dark-gray);
}
.btn-primary:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}
.btn-secondary:hover {
    background-color: #1e88b9;
}

.hidden { display: none; }

/* Animation on Scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.fade-in {
    opacity: 1;
    transform: translateY(0);
}


/* Header & Navigation */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo img {
    height: 100px;
    padding: 10px 0;
    width: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--text-color);
    padding: 0.5rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary-color);
    font-weight: 500;
}
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}


.header-cta .btn {
    padding: 8px 15px;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }


/* Hero Section */
#hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/hero-bg.jpeg') no-repeat center center/cover;
    color: var(--white);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 0;
}

.hero-content h1 {
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* About Section */
.about-content p {
    margin-bottom: 1.5rem;
}

.financing {
    font-size: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: underline;
}

/* Services & Why Choose Us (Features) Section - 2x2 Grid */
.section-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #555;
}
.services-grid,
.features-grid {
    display: grid;
    /* Default to 1 column for smaller screens, then 2 columns */
    grid-template-columns: 1fr; 
    gap: 2rem;
    margin-top: 2rem;
}

.service-card,
.feature-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover,
.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.service-card img {
    width: 100%;
    height: 180px; /* Keep this for consistent card image area before text */
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    margin-bottom: 1rem;
}
.service-icon, /* Shared icon style for service and feature cards */
.feature-item i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}
.service-card h3,
.feature-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem; /* Harmonized font size */
}
/* Apply 2-column layout for medium screens and up */
@media (min-width: 768px) {
    .services-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Shingle Brands Section */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.brand-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
}
.brand-card img {
    max-height: 80px;
    width: auto;
    margin: 0 auto 1rem;
}
.brand-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}


/* Gallery Section - Slider */
.gallery-slider-container {
    position: relative;
    width: 100%;
    max-width: 800px; /* Adjust max width as needed */
    margin: 2rem auto 0;
    overflow: hidden; /* Crucial for slider */
    border-radius: 8px;
}

.gallery-slider {
    display: flex; /* Allows items to sit side-by-side */
    transition: transform 0.5s ease-in-out;
    /* No fixed width, it will be sum of all items */
}

.gallery-item {
    /* min-width: 100%; Make each item take full width of the *container* */
    /* For variable width, we let image dictate its width within the slide. */
    /* We need to ensure the *slider* container itself can be scrolled. */
    /* So, each gallery-item will be as wide as its content (the image) */
    flex-shrink: 0; /* Prevent items from shrinking to fit */
    box-sizing: border-box;
    position: relative;
    margin-right: 10px; /* Optional spacing between slides */
}
.gallery-item:last-child {
    margin-right: 0;
}

.gallery-item img {
    width: auto; /* Allow image to dictate its width */
    max-width: 100%; /* Ensure it doesn't overflow its item container */
    max-height: 450px; /* Set a max-height to prevent extremely tall images from breaking layout */
    /* height: auto; REMOVED fixed height and object-fit */
    display: block;
    border-radius: 4px; /* Optional: slightly rounded image corners */
    margin: 0 auto;
}
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.8rem;
    text-align: center;
    font-size: 0.9rem;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5rem;
    z-index: 10;
    transition: background-color 0.3s ease;
}
.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Lightbox Styles REMOVED */


/* Testimonials Section */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.testimonial-card {
    background: var(--white);
    padding: 2rem;
    border-left: 5px solid var(--secondary-color);
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.testimonial-card p {
    font-style: italic;
    margin-bottom: 1rem;
}
.testimonial-card h4 {
    text-align: right;
    color: var(--primary-color);
    font-weight: bold;
}

/* Contact Section */
#contact form {
    max-width: 700px;
    margin: 2rem auto 0;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
#contact form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}
#contact form input[type="text"],
#contact form input[type="email"],
#contact form input[type="tel"],
#contact form select,
#contact form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-primary);
}
#contact form textarea {
    resize: vertical;
}
#contact form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Footer */
footer {
    background-color: var(--dark-gray);
    color: #ccc;
    padding-top: 3rem;
}
.footer-content {
    display: grid;
    /* Adjust for 2 columns in footer now that social is gone */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem;
    padding-bottom: 2rem;
}
.footer-content h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.footer-contact p, .footer-links ul li {
    margin-bottom: 0.5rem;
}
.footer-contact a, .footer-links a {
    color: #ccc;
    transition: color 0.3s ease;
}
.footer-contact a:hover, .footer-links a:hover {
    color: var(--accent-color);
}
.footer-links ul {
    list-style: none;
}
.footer-bottom {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }

    .nav-toggle {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        background-color: var(--white);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        transition: right 0.3s ease-in-out;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        padding-top: 4rem;
    }
    .nav-links.active {
        right: 0;
    }
    .nav-links li {
        margin: 1rem 0;
    }
    .nav-links .header-cta {
        margin-top: 1rem;
    }

    .nav-toggle.active .hamburger {
        background-color: transparent;
    }
    .nav-toggle.active .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .nav-toggle.active .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }

    #hero {
        min-height: 60vh;
        padding: 3rem 0;
    }
    .hero-content p {
        font-size: 1rem;
    }

    /* Grids default to 1 column on small screens */
    .services-grid, 
    .features-grid, 
    .testimonials-grid, /* Testimonials already auto-fit, but good to be explicit */
    .brands-grid,
    .footer-content {
        grid-template-columns: 1fr;
    }

    .slider-btn {
        padding: 8px 12px;
        font-size: 1.2rem;
    }
    .gallery-item img {
        max-height: 300px; /* Adjust max height for mobile gallery images */
    }
}

@media (min-width: 500px) and (max-width: 767px) {
    /* For slightly larger small screens, allow 2 columns for brands if space allows */
    .brands-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}