:root {
    /* Main Brand Colors */
    --brand-navy: #004581;
    --brand-gold: #E7B517;
    --brand-blue-light: #0066B2;
    --text-dark: #3C3C3B;

    /* Functional assignments */
    --primary: var(--brand-navy);
    --accent: var(--brand-gold);
}

.container {
    max-width: 1100px; /* Or 1200px, whichever you prefer site-wide */
    margin: 0 auto;
    padding: 0 20px;
}
/* Example of applying the colors to your star ratings */
.stars {
    color: var(--brand-gold); /* Matches the DHB Gold */
    font-size: 1.4rem;
}

/* Example of applying to buttons */
.btn-quote, .btn-submit {
    background-color: white;
    color: #ffffff;
    transition: background 0.3s;
}

.btn-quote:hover {
    background-color: var(--brand-blue-light);
}

/* --- Quote Form Polish --- */

/* Fix the cramping between the last input and the button */
.quote-form .form-group:last-of-type {
    margin-bottom: 30px;
}

/* Make the button clearly visible and distinct */
.btn-quote-submit {
    display: block;
    width: 100%; /* Full width on mobile is easier to tap */
    padding: 18px;
    background-color: var(--brand-navy) !important; /* Force the visibility */
    color: #ffffff !important;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-quote-submit:hover {
    background-color: var(--brand-gold) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Arial', sans-serif; background: #fafafa; color: var(--dark); }

/* --- DESKTOP (No Changes) --- */
.menu-toggle { display: none; } /* Hidden on desktop */



/* --- Optimized Header Stack --- */

header {
    padding: 5px 0 3px 0; /* Balanced padding */
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-centered-stack {
    display: flex;
    align-items: center;
    gap: 30px; /* Space between brand and nav */
}

.brand-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.main-logo {
    height: 100px; /* Keep your logo nice and large */
    width: auto;
    align-items: flex-start;
}

.header-content-stack {
    display: flex;
    flex-direction: column;
    align-items: center; /* Aligns both rows to the right */
    gap: 5px; /* Tiny gap between name and links */
}

.brand-name h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem; /* Slightly reduced for a sleek look */
    color: var(--brand-navy);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #eee; /* Subtle line to separate brand from nav */
}

.nav-links a {
    text-decoration: none;
    color: #444;
    font-weight: 400;
    font-size: 0.9rem; /* Slightly smaller to fit the stack look */
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--brand-navy);
}

/* Optional: Make the CTA stand out in the stack */
.nav-cta {
    color: var(--brand-gold) !important;
    font-weight: 700 !important;
}

.dream-home-script {
    font-family: "Great Vibes", cursive;
    font-size: 2.5rem;          /* adjust as needed */
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #2c2c2c;           /* elegant charcoal */
    line-height: 1.1;
    align-content: center;
}

.map-container {
    margin-top: 50px;
    border-radius: 15px;
    overflow: hidden; /* Rounds the corners of the map */
    border: 3px solid var(--brand-navy); /* Using your logo's Navy color */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    display: block; /* Removes any tiny white space at the bottom */
}

/* --- Updated Page Switching Logic --- */

/* All sections are now visible and stacked */
section.page, section.hero-slider {
    display: block !important;
    min-height: 100vh; /* Ensures each section fills the screen */
    width: 100%;
    padding-top: 80px;      /* Gap at the top of the section */
    padding-bottom: 20px;   /* Gap at the bottom of the section */
    border-bottom: 1px solid #eeeeee; /* Optional: adds a very light divider line */
}

/* Ensure the Home/Hero section doesn't have a massive gap at the very top */
#home {
    padding-top: 0 !important;
}

/* Remove the border from the very last section (usually Contact) */
section:last-of-type {
    border-bottom: none;
}


html {
    scroll-behavior: smooth; /* This makes the "jump" look like a scroll */
}

/* Only show the section with the .active class */
#home.active {
    display: block !important;
    animation: fade 0.6s ease-in-out;
}

/* --- Footer Styling --- */
.main-footer {
    background-color: var(--brand-navy);
    color: white;
    padding: 60px 0 20px;
    margin-top: 0; /* Fits perfectly under the last section */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h3 span {
    color: var(--brand-gold);
}

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

.footer-links a {
    color: #ccc;
    text-decoration: none;
    line-height: 2;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--brand-gold);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

/* --- Back to Top Button --- */
#backToTop {
    display: none; /* Controlled by JS */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001; /* Above the header */
    background-color: var(--brand-gold);
    color: var(--brand-navy);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
}

#backToTop:hover {
    transform: translateY(-5px);
    background-color: white;
}

/* --- Request Quote Section --- */
.quote-form {
    background: #f9f9f9;
    padding: 40px;
    border-radius: 8px;
    border-top: 5px solid var(--brand-gold);
    max-width: 800px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns on desktop */
    gap: 20px;
}

.quote-form label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--brand-navy);
}

.quote-form select,
.quote-form input,
.quote-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.quote-header {
    text-align: center;
    margin-bottom: 30px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.category-card {
    cursor: pointer;
}

.category-card input {
    display: none; /* Hide the actual radio circle */
}

.card-content {
    background: white;
    border: 2px solid #eee;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.card-content i {
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--brand-navy);
}

.card-content span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Hover state */
.category-card:hover .card-content {
    border-color: var(--brand-gold);
    transform: translateY(-3px);
}

/* Selected state - when the radio is checked */
.category-card input:checked + .card-content {
    border-color: var(--brand-gold);
    background-color: #fff9eb; /* Light gold tint */
}

.category-card input:checked + .card-content i {
    color: var(--brand-gold);
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd; /* Matches your other form fields */
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s;
}

/* Highlight the box when the dropdown is open */
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--brand-gold);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-options {
    position: absolute;
    display: none;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--brand-gold);
    border-top: none;
    background: #fff;
    z-index: 100;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.custom-option {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--brand-navy);
}

.custom-option i {
    width: 20px;
    color: var(--brand-gold);
    text-align: center;
}

.custom-option:hover {
    background-color: #fff9eb; /* Subtle gold highlight on hover */
    cursor: pointer;
}

/* Ensure this is in your layout.css */
.custom-select-wrapper.open .custom-options {
    display: block !important;
}

.arrow {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
    min-height: 400px; /* Prevents layout jump when switching tabs */
}

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 250px;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps construction photos looking uniform */
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Lightbox Styles --- */
.lightbox {
    display: none; /* Keep hidden by default */
    position: fixed;
    z-index: 9999; /* Higher than your header/nav! */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 33, 71, 0.9); /* Brand Navy */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Add this to make sure the image is actually visible */
.lightbox-content {
    display: block;
    max-width: 90%;
    max-height: 80%;
    margin: auto;
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 50px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
}

#lightbox-caption {
    color: var(--brand-gold);
    margin-top: 15px;
    font-size: 1.2rem;
    text-transform: capitalize;
}

/* --- Success Page Styles --- */
.success-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f4f7f6;
    margin: 0;
}

.success-container {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 5px solid var(--brand-gold);
    max-width: 500px;
    width: 90%;
}

.success-container i {
    font-size: 60px;
    color: var(--brand-gold);
    display: block;
    margin-bottom: 20px;
}

.success-container h1 {
    color: var(--brand-navy);
    margin-bottom: 15px;
}

.btn-home {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--brand-navy);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
}

/* --- Lightbox Navigation Buttons --- */
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 20px 15px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1010;
    transition: background 0.3s;
    border-radius: 5px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: var(--brand-gold);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* --- Consistent Lightbox Frame --- */

.lightbox-content {
    width: 80vw;
    height: 80vh;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #0b0b0b; /* A slightly softer 'charcoal' black */

    /* THE FIX: Thin, elegant border */
    border: 1px solid rgba(231, 181, 23, 0.3); /* Subtle 30% brand-gold */
    border-radius: 4px; /* Sharper corners look more architectural */

    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8); /* Deep shadow to make it 'pop' from background */
    overflow: hidden;
}

#lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease-in-out; /* For that smooth JS fade we added */
}

#lightbox-caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    text-transform: capitalize;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    /* 1. Header: Force it to stay on top */
    /* Animate Bars into X */
    #mobile-menu.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    #mobile-menu.active .bar:nth-child(2) {
        opacity: 0;
    }
    #mobile-menu.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    header {
        position: relative;
        z-index: 99999 !important;
        background: #ffffff;
        min-height: 80px;
        display: flex;
        align-items: center;
    }

    /* 2. Alignment Trio: Keep them in one row */
    .header-centered-stack {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
    }

    #mobile-menu.menu-toggle {
        display: flex !important;
        position: absolute !important;
        left: 20px;
        z-index: 100001 !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        cursor: pointer;
    }

    .bar {
        width: 100%;
        height: 3px;
        background-color: #004581;
        display: block;
    }

    /* 3. THE FIX: The Dropdown Links */
    .nav-links {
        display: none !important; /* Hidden until toggled */

        /* THE MAGIC PILL: 'fixed' breaks the menu out of the slider's cage */
        position: fixed !important;
        top: 80px !important; /* Exactly the height of your header */
        left: 0 !important;
        width: 40vw !important; /* Full width of the viewport */
        height: auto !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding-bottom: 5px !important;
        align-items: center !important;
        background-color: #ffffff !important;
        z-index: 100000 !important; /* Higher than ANY other element on the page */
        gap: 1px !important;
        flex-direction: column !important;
        box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
        list-style: none !important;
        border-bottom: 4px solid #004581;
    }

    /* Activated by your JS */
    .nav-links.active {
        display: flex !important;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }

    .nav-links a {
        color: #004581 !important;
        font-weight: bold;
        text-decoration: none;
        font-size: 0.5rem !important;
        display: block;
    }

    /* Shrink the text slightly so it's less likely to overflow */
    .nav-links li a {
        font-size: 1.2rem !important;
        padding: 12px 0 !important;
    }

    /* Logo and Title side-by-side */
    .main-logo, .header-content-stack {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important;
    }

    img.main-logo { height: 45px !important; width: auto !important; margin-right:0 !important; margin-left: 50px !important;}
    .dream-home-script { font-size: 1.5rem !important; white-space: nowrap; margin: 0 !important; font-weight: bold;}
}