:root {
    /* Updated Color Palette */
    --primary: #964B00;
    /* Deep Brown */
    --secondary: #966919;
    /* Golden Brown */
    --accent: #C19A6B;
    /* Tan / Camel */
    --light: #DAA06D;
    /* Buff / Light Tan */
    --bg-body: #FFFFFF;
    /* White */
    --bg-card: #FDF9F5;
    /* Very light warm tint */
    --text-main: #2d2d2d;
    --text-muted: #555555;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(150, 75, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #1a1a1a;
    --bg-card: #25221f;
    /* Dark warm gray-brown */
    --text-main: #f0f0f0;
    --text-muted: #cccccc;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
    color: var(--primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: var(--light);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(150, 75, 0, 0.3);
}

.js-hidden { display: none; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

/* Header & Nav */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--accent);
}

[data-theme="dark"] header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid var(--primary);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 60px;
    /* Adjust based on your logo's aspect ratio */
    width: auto;
    object-fit: contain;
}

.logo-text {
    margin-left: 1rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

[data-theme="dark"] .logo-text {
    color: var(--light);
}

.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
    background: rgba(255, 255, 255, 0.1);
    /* Subtle backing if logo is dark transparent */
    padding: 10px;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
}

[data-theme="dark"] .hamburger {
    color: var(--light);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--secondary);
}

/* Dark Mode Toggle */
#theme-toggle {
    background: none;
    border: 2px solid var(--accent);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

[data-theme="dark"] #theme-toggle {
    color: var(--light);
    border-color: var(--secondary);
}

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.nav-search input {
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
    width: 220px;
    transition: var(--transition);
    font-family: inherit;
}

.nav-search input:focus {
    width: 280px;
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(150, 75, 0, 0.15);
}

.nav-search i {
    position: absolute;
    left: 1rem;
    color: var(--primary);
    font-size: 0.9rem;
    pointer-events: none;
}

[data-theme="dark"] .nav-search input {
    background: #2a2a2a;
    border-color: var(--secondary);
}

[data-theme="dark"] .nav-search i {
    color: var(--light);
}

@media (max-width: 992px) {
    .nav-search {
        display: none;
    }
}

/* Mobile search styling */
.mobile-search-container {
    display: none; /* Hide on desktop */
    padding: 0 1rem 1.5rem 0;
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--accent);
}

.mobile-search-container .nav-search {
    display: flex !important;
    margin-right: 0;
    width: 100%;
}

.mobile-search-container .nav-search input {
    width: 100% !important;
    background: var(--bg-body);
}

/* Hero Section */
#hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

#hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    color: var(--white);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-inline: auto;
    color: var(--white);
}

/* About Section */
#about {
    padding: 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 15px 15px 0px var(--accent);
    border: 1px solid var(--light);
}

.badge {
    display: inline-block;
    background: var(--light);
    color: var(--white);
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Expertise Section */
#services {
    padding: 100px 0;
    background-color: var(--bg-card);
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-body);
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent);
}

.service-card:hover {
    border-top-color: var(--primary);
    transform: translateY(-5px);
    background-color: var(--bg-card);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

/* Projects Section */
#projects {
    padding: 100px 0;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--accent);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.project-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    border-bottom: 2px solid var(--accent);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    transition: var(--transition);
}

[data-theme="dark"] .project-info h3 {
    color: var(--accent);
}

.view-details-link {
    display: inline-block;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.view-details-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.project-info p {
    color: var(--text-main);
    line-height: 1.6;
}

.project-description {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-muted);
}

[data-theme="dark"] .project-description {
    color: var(--white);
}

/* Contact Section */
#contact {
    padding: 60px 0;
    background-color: var(--bg-card);
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-body);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 5px rgba(150, 75, 0, 0.2);
}

/* Footer */
footer {
    padding: 4rem 0 1.5rem;
    background: var(--primary);
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

footer h3 {
    color: var(--light) !important;
    margin-bottom: 1rem;
}

.footer-info {
    text-align: left;
}

.footer-info p {
    margin-bottom: 1rem;
    color: var(--white);
    line-height: 1.5;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: center;
}

.footer-socials a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-socials a:hover {
    opacity: 1;
    color: var(--secondary);
    transform: translateY(-3px);
}

.footer-map iframe {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--secondary);
}

.footer-bottom {
    margin-top: 2rem;
    font-size: 0.8rem;
    opacity: 0.8;
    border-top: 1px solid var(--secondary);
    padding-top: 1rem;
    text-align: center;
}

/* Mobile Footer adjustments */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .footer-info {
        text-align: center;
    }

    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile Nav */
@media (max-width: 768px) {
    .logo-text {
        display: none;
    }

    .hamburger {
        display: block;
        z-index: 1002;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--bg-body);
        padding: 100px 1.5rem 2rem;
        display: flex; /* Changed from none */
        flex-direction: column;
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        z-index: 1001;
        transition: var(--transition);
        text-align: left;
        gap: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(150, 75, 0, 0.1);
    }

    .nav-links li a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    /* Overlay when menu is open */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-controls {
        gap: 0.5rem;
    }

    .mobile-search-container {
        display: block;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image img {
        box-shadow: 10px 10px 0px var(--accent);
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Service Card Hover Effects */
/* Apply background images (wallpapers) on hover with a dark overlay for text readability */

#service-kitchens:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Custom Wood Kitchens/1.webp');
    background-size: cover;
    background-position: center;
}

#service-remodeling:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Kitchen Cabinet Remodeling & Upgrades/1.webp');
    background-size: cover;
    background-position: center;
}

#service-closets:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Custom Closets & Wardrobe Systems/1.webp');
    background-size: cover;
    background-position: center;
}

#service-sinks:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Sink Cabinets & Under-Sink Solutions/1.webp');
    background-size: cover;
    background-position: center;
}

#service-laundry:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Laundry Room Cabinetry & Storage/1.webp');
    background-size: cover;
    background-position: center;
}

#service-furniture:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('Images/Handcrafted Coffee Tables & Accent Furniture/1.webp');
    background-size: cover;
    background-position: center;
}

/* Change text on hover only in dark mode */
[data-theme="dark"] .service-card:hover {
    color: #f0f0f0;
}

[data-theme="dark"] .service-card:hover h3 {
    color: var(--light);
}

[data-theme="dark"] .service-card:hover .service-icon {
    color: var(--light);
}

/* ========================================================================= 
 * BEFORE & AFTER SLIDER STYLES
 * ========================================================================= */
.comparison-section {
    padding: 60px 0;
    background-color: var(--bg-body);
}

.comparison-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    border: 4px solid var(--accent);
}

.comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.comparison-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.before-image {
    width: 100%;
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.after-image {
    z-index: 1;
}

/* Maintain full size layout, letting clip-path do the masking */
.before-image img {
    width: 100%;
    height: 100%;
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 100%;
    z-index: 3;
    transform: translateX(-50%);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}

.slider-line {
    position: absolute;
    width: 4px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-button {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    z-index: 4;
}

.comparison-label {
    position: absolute;
    bottom: 20px;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    z-index: 10;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.label-before {
    left: 20px;
}

.label-after {
    right: 20px;
}

@media(max-width: 768px) {
    .comparison-container {
        aspect-ratio: 4/3;
    }

    .slider-button {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    border: 2px solid white;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-5px);
    color: white;
}

.back-to-top i {
    font-size: 1.2rem;
}