/* =====================================================
   CSS Variables for Theming
===================================================== */
:root {
    /* Color Palette */
    --primary-color: #FFF;
    --secondary-color: #D9734E;
    --accent-color: #732C02;
    --background-color: #FFF;
    --text-color: #333;
    --link-color: #21130d;
    --button-hover-color: #8b4c0a;

    /* Font Families */
    --font-family-primary: "Space Grotesk", sans-serif;
    --font-family-secondary: "Bebas Neue", sans-serif;

    /* Transition Speed */
    --transition-speed: 0.3s;

    /* Box Shadows */
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Breakpoints */
    --breakpoint-mobile: 768px;

    /* Navbar Height */
    --navbar-height: 200px; /* Adjust this value to match your navbar's height */
}

/* =====================================================
   Reset and Base Styles
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* =====================================================
   Container
===================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

/* =====================================================
   Typography
===================================================== */
h1 {
    font-family: var(--font-family-primary);
    font-weight: 600;
    color: var(--text-color);
}

h2, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: 600;
    color: var(--text-color);
}

h3 {
    font-family: var(--font-family-secondary);
    font-weight: 600;
    color: #333;
}

p {
    font-size: 1em;
    margin-bottom: 1.5em;
    color: var(--text-color);
}

/* =====================================================
   Header Styles with Flexbox
===================================================== */
header {
    background: var(--primary-color);
    color: var(--link-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--box-shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo img {
    height: clamp(50px, 10vw, 200px); /* Responsive height between 50px and 150px */
    width: auto;
    transition: transform var(--transition-speed) ease;
}

header .logo img:hover {
    transform: scale(1.05);
}

/* =====================================================
   Navigation Styles
===================================================== */
nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
    position: relative;
    transition: color var(--transition-speed) ease;
}

nav ul li a:hover,
nav ul li a:focus {
    color: var(--secondary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    display: block;
    background: var(--secondary-color);
    transition: width var(--transition-speed) ease;
    left: 0;
    bottom: -5px;
}

nav ul li a:hover::after,
nav ul li a:focus::after {
    width: 100%;
}

/* =====================================================
   Hamburger Menu (Mobile)
===================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    height: 3px;
    width: 25px;
    background: var(--link-color);
    margin-bottom: 4px;
    border-radius: 2px;
    transition: all var(--transition-speed) ease;
}

/* Transform Hamburger to X when active */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =====================================================
   Responsive Header Navigation
===================================================== */
@media (max-width: 768px) {
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--primary-color);
    }

    nav ul.show {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    nav ul li {
        margin: 10px 0;
    }

    header .logo img {
        height: clamp(50px, 10vw, 200px); /* Ensured responsive sizing */
    }
}

/* =====================================================
   Hero Section
===================================================== */
.hero {
    position: relative;
    background: url('../images/hero-background.png') no-repeat center center/cover;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers content horizontally */
    text-align: center;
    color: #f0f0f0; /* Lighter text color */
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Darker overlay */
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero h2 {
    font-size: 4em;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s ease forwards;
    color: #f0f0f0;
}

.hero p {
    font-size: 1.5em;
    font-weight: 500;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1.2s ease forwards;
    color: #f0f0f0;
}

.hero .btn {
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--transition-speed) ease, transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    font-family: var(--font-family-primary);
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
}

.hero .btn:hover {
    background: var(--accent-color);
    transform: translateY(-3px) scale(1.02); /* Slight scaling for subtle effect */
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* =====================================================
   Keyframes for Animations
===================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   About Section
===================================================== */
.about {
    padding: 60px 0;
    background: var(--background-color);
    text-align: center;
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
}

.about h2 {
    margin-bottom: 20px;
    font-size: 2.5em;
}

.about p {
    font-size: 1.1em;
    max-width: 800px;
    margin: auto;
}

/* =====================================================
   Services Section
===================================================== */
.services {
    padding: 60px 0;
    text-align: center;
}

.services h2 {
    margin-bottom: 40px;
    font-size: 2.5em;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
}

.service-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    width: 100%;
    padding: 20px;
    transition: box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
    overflow: hidden;
    position: relative;
}

.service-item:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    transform: translateY(-5px);
}

.service-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    border-radius: 5px;
    transition: transform var(--transition-speed) ease;
}

.service-item img:hover {
    transform: scale(1.05);
}

.service-item h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.service-item p {
    margin-bottom: 15px;
}

/* =====================================================
   Free Installation Section Styles
===================================================== */
.free-installation {
    background-color: #fff8f0; /* Light background to make it stand out */
    padding: 60px 0;
    text-align: center;
}

.free-installation .container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

.free-installation h2 {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.free-installation p {
    font-size: 1.2em;
    color: #555;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

.free-installation .benefits {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.free-installation .benefit {
    flex: 1 1 30%;
    background-color: #fff;
    padding: 20px;
    margin: 10px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.free-installation .benefit:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.free-installation .benefit img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

.free-installation .benefit h3 {
    font-size: 1.5em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.free-installation .benefit p {
    font-size: 1em;
    color: #666;
}

.free-installation .btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1em;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.free-installation .btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 992px) {
    .free-installation .benefits {
        flex-direction: column;
        align-items: center;
    }
    
    .free-installation .benefit {
        flex: 1 1 80%;
    }
}

@media (max-width: 480px) {
    .free-installation h2 {
        font-size: 2em;
    }
    
    .free-installation p {
        font-size: 1em;
    }
    
    .free-installation .benefit {
        flex: 1 1 100%;
        margin: 10px 0;
    }
}

/* =====================================================
   Partners Section
===================================================== */
.partners {
    padding: 60px 0;
    background: var(--background-color);
    text-align: center;
}

.partners h2 {
    margin-bottom: 20px;
    font-size: 2.5em;
}

.partner-logo img {
    display: block;
    max-width: 700px;
    margin: 0 auto;
    margin-bottom: 30px;
}

.partners p {
    font-size: 1.1em;
    max-width: 600px;
    margin: auto;
}

/* =====================================================
   Locations Section
===================================================== */
.locations {
    padding: 60px 0;
    text-align: center;
}

.locations h2 {
    margin-bottom: 20px;
    font-size: 2.5em;
}

.locations p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* Responsive Iframe Container */
.map-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
} 

/* =====================================================
   Testimonials Section
===================================================== */
.testimonials {
    padding: 60px 0;
    background: var(--background-color);
    text-align: center;
}

.testimonials h2 {
    margin-bottom: 40px;
    font-size: 2.5em;
}

.testimonial-slider {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
}

.testimonial-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform var(--transition-speed) ease;
    scroll-snap-align: center;
}

.testimonial-item:hover {
    transform: translateY(-5px);
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 15px;
}

.testimonial-item h4 {
    font-weight: bold;
    color: var(--primary-color);
}

/* =====================================================
   Contact Section
===================================================== */
.contact {
    padding: 60px 0;
    background: var(--background-color);
}

.contact h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.contact form {
    max-width: 600px;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.contact label {
    margin-bottom: 5px;
    font-weight: bold;
}

.contact input, 
.contact textarea {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.contact input:focus, 
.contact textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(181, 101, 29, 0.5);
    outline: none;
}

.contact button {
    align-self: center;
    background: var(--secondary-color);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.contact button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.contact-info {
    text-align: center;
    margin-top: 40px;
}

.contact-info p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* =====================================================
   Footer Styles
===================================================== */
footer {
    background: var(--primary-color);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    position: relative;
}

footer p {
    margin-bottom: 10px;
}

footer .social-media a {
    margin: 0 10px;
    display: inline-block;
    transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

footer .social-media a:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

footer .social-media img {
    width: 48px;
    height: 48px;
}

.footer-logo img {
    display: block;
    margin: 0 auto;
    height: clamp(60px, 8vw, 200px); /* Responsive footer logo height */
    width: auto;
    margin-bottom: 40px;
}

/* Responsive Logo Sizes */
@media (max-width: 768px) {
    .footer-logo img {
        height: clamp(60px, 8vw, 80px); /* Smaller logo on tablets */
    }
}

@media (max-width: 480px) {
    .footer-logo img {
        height: clamp(50px, 8vw, 60px); /* Even smaller logo on mobiles */
    }
}

/* =====================================================
   Back-to-Top Button
===================================================== */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: none;
    transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
    z-index: 1000;
}

#back-to-top:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* =====================================================
   Loader Styles
===================================================== */
#loader {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--secondary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Visually Hidden Class for Accessibility
===================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =====================================================
   Fade-In Animation for Sections
===================================================== */
section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
    scroll-margin-top: var(--navbar-height);
}

section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   Additional Button Styles
===================================================== */
.btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* =====================================================
   Accessibility: Skip Link
===================================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--secondary-color);
    color: #fff;
    padding: 8px 16px;
    z-index: 1001;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* =====================================================
   Responsive Image Handling
===================================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   Dark Mode Toggle Button (Optional)
===================================================== */
#theme-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
    z-index: 1000;
}

#theme-toggle:hover {
    background: var(--accent-color);
    transform: rotate(360deg);
}

/* =====================================================
   Loader and Page Transition Enhancements
===================================================== */
body.loading {
    overflow: hidden;
}

body.loading #loader {
    display: flex;
}

body:not(.loading) #loader {
    display: none;
}

/* =====================================================
   Scrollbar Styling (Optional)
===================================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 10px;
    border: 2px solid var(--background-color);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
}

/* =====================================================
   Media Queries for Enhanced Responsiveness
===================================================== */
@media (max-width: 1024px) {
    .hero h2 {
        font-size: 2.5em;
    }

    .hero p {
        font-size: 1em;
    }

    .services h2, 
    .partners h2, 
    .locations h2, 
    .testimonials h2, 
    .contact h2 {
        font-size: 2em;
    }

    .services-grid, 
    .testimonial-slider {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 2em;
    }

    .hero p {
        font-size: 0.9em;
        color: #f0f0f0; /* Lighter shade of white */
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    header .logo img {
        height: clamp(50px, 10vw, 200px); /* Responsive sizing */
    }

    #theme-toggle {
        padding: 8px 12px;
        font-size: 14px;
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        padding: 8px 12px;
        font-size: 16px;
    }

    .contact form {
        padding: 0 10px;
    }
}
