/*
Theme Name: Matt's Window Cleaning
Theme URI: 
Author: Oliver Pierce
Author URI: 
Description: Custom WordPress theme for Matt's Window Cleaning Services, integrated with ACF.
Version: 1.0.4
Text Domain: matts-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary: #004aad;
    --primary-light: #00a3ff; /* Eliza Blue */
    --accent: #00a3ff;       /* Replacing yellow with Eliza Blue */
    --text: #1a1a1a;
    --text-light: #666;
    --white: #ffffff;
    --bg-light: #f8fbff;
    --glass: rgba(0, 163, 255, 0.9); /* Blue glass */
    --shadow: 0 10px 30px rgba(0, 74, 173, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

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

html, body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

header.scrolled {
    background: var(--white);
    padding: 0.8rem 0;
    box-shadow: var(--shadow);
}

header.scrolled .nav-links a {
    color: var(--primary);
}

header.scrolled .logo img {
    filter: none;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    color: var(--white); /* White menu items */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--primary-light);
    opacity: 1;
}

/* Dropdown Styles */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 250px;
    box-shadow: var(--shadow);
    border-radius: 10px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    color: var(--primary) !important;
    padding: 0.8rem 1.5rem;
    display: block;
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-light) !important;
}

/* Mobile Dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        min-width: 100%;
    }

    .has-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 0;
    }

    .dropdown-menu li {
        border-bottom: none !important;
    }

    .dropdown-menu a {
        color: var(--primary) !important;
        padding: 0.8rem 2.5rem;
        font-size: 1rem !important;
        opacity: 0.8;
    }
}

.btn-cta {
    background: var(--primary-light);
    color: var(--white);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
    border: 2px solid transparent;
    display: inline-block;
    white-space: nowrap;
    text-align: center;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.4);
    background: var(--primary);
    color: var(--white);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 74, 173, 0.7), rgba(0, 74, 173, 0.5)), url('assets/hero.png');
    background-size: cover;
    background-position: center;
    color: var(--white);
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s backwards;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-light);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
}

/* Stats Section */
.stats {
    background: var(--primary);
    color: var(--white);
    padding: 5rem 0;
    margin: 5rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--white);
}

/* Areas Section */
.areas {
    padding: 5rem 0;
    text-align: center;
}

.area-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.area-tag {
    background: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow);
    border: 1px solid var(--primary-light);
}

/* Footer */
footer {
    background: #111;
    color: var(--white);
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.6;
}

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

/* Mobile Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--white);
    border-radius: 10px;
    transition: var(--transition);
}

#header.scrolled .menu-toggle span {
    background: var(--primary);
}



.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -8px);
}

@media (max-width: 768px) {
    header {
        padding: 0.5rem 0;
    }

    .container {
        padding: 0 2rem; /* Restore standard padding for safer margins */
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: auto;
        background: var(--white);
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 1.5rem 2rem;
        gap: 0;
        transition: none;
        z-index: 1000;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
        right: auto;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        opacity: 1;
        transform: none;
        text-align: left;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links li a {
        font-size: 1.2rem;
        padding: 1.2rem 0;
        width: 100%;
        color: var(--primary) !important;
        font-weight: 500;
        display: block;
        position: relative;
    }

    /* Disable desktop underlines on mobile */
    .nav-links li a::after {
        display: none !important;
    }

    .nav-links li a.active {
        color: var(--primary-light) !important;
    }

    /* Fix mobile CTA button in menu */
    .nav-links li.mobile-only {
        padding: 1.5rem 0 1rem;
        border-bottom: none;
        text-align: center;
    }

    .nav-links li .btn-cta {
        display: inline-block;
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        border-radius: 12px;
        background: var(--primary-light);
        color: var(--white) !important;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
    }

    header.scrolled .menu-toggle span {
        background: var(--primary);
    }

    .header-cta-desktop {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 50vh; /* Ensure enough space */
        height: auto !important;
        padding: 6rem 0; /* Add top/bottom padding for breathing room */
        overflow: hidden;
    }

    .hero h1 {
        font-size: 2.2rem !important; /* Force this size to override any remaining inline styles */
        margin: 0 auto 1.5rem !important;
        max-width: 90vw;
        line-height: 1.1;
        display: block;
        width: 100%;
    }

    .hero p {
        font-size: 1.1rem;
        max-width: 85vw;
        margin: 0 auto;
    }

    .hero .container,
    .hero-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 1.5rem;
        box-sizing: border-box;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-btns .btn-cta {
        width: 100%;
        margin-right: 0 !important;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .service-row .service-img,
    .about-content-section .about-img {
        order: 1 !important;
    }

    .service-row .service-text,
    .about-content-section .about-content {
        order: 2 !important;
    }

    .about-content-section .container > div {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        text-align: center;
    }

    .about-stats {
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo img {
        margin: 0 auto 1.5rem;
    }

    .contact-grid {
        grid-template-columns: 1fr !important;
    }

    .form-row-mobile {
        grid-template-columns: 1fr !important;
    }

    .mobile-only {
        display: block !important;
    }
}

/* Service Page Specific Layouts */
.service-section {
    padding: 8rem 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    margin-bottom: 6rem;
}

.feature-grid {
    background: var(--white);
    padding: 4rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.cta-box {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
    background: var(--white);
    padding: 4rem;
    border-radius: 30px;
    border: 1px solid rgba(0, 163, 255, 0.1);
    box-shadow: var(--shadow);
}

.cta-btn-wrapper {
    text-align: right;
}

@media (max-width: 768px) {
    .service-section {
        padding: 4rem 0;
    }

    /* Hero h1 size handled by main media query */

    .detail-row {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        margin-bottom: 4rem;
    }

    .detail-row .service-img {
        order: -1;
    }

    .feature-grid {
        display: block; /* Stack boxes vertically */
        background: transparent; /* Remove parent background */
        padding: 0; /* Remove parent padding */
        box-shadow: none; /* Remove parent shadow */
        margin-bottom: 4rem;
    }

    .feature-grid > div {
        background: var(--white);
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
        box-shadow: var(--shadow); /* Each box gets its own shadow */
        margin-bottom: 2rem; /* The gap between boxes */
    }

    .feature-grid > div:last-child {
        margin-bottom: 0;
    }

    .feature-grid h4 {
        font-size: 1.3rem;
        margin-top: 0.5rem;
    }

    .feature-grid p {
        font-size: 1rem;
        margin-top: 0.5rem;
        line-height: 1.5;
    }

    .feature-grid i {
        font-size: 2.5rem !important;
    }

    .cta-box {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.5rem;
        text-align: center;
    }

    .cta-btn-wrapper {
        text-align: center;
    }
    .cta-box .btn-cta {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .detail-row .service-img {
        order: 1;
    }

    .detail-row .service-text {
        order: 2;
    }
}

/* Testimonials Section */
.testimonials-section {
    padding: 8rem 0;
    background: var(--bg-light);
    overflow: hidden;
}

.testimonials-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 1rem;
}

.testimonial-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.testimonial-slide {
    flex: 0 0 33.333%;
    padding: 1rem;
}

.testimonial-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-card i.fa-quote-left {
    font-size: 2rem;
    color: var(--primary-light);
    opacity: 0.1;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.testimonial-text {
    font-size: 1.1rem;
    color: var(--primary);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
}

.testimonial-service {
    display: block;
    font-size: 0.8rem;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

@media (max-width: 1024px) {
    .testimonial-slide {
        flex: 0 0 50%;
    }
}

@media (max-width: 768px) {
    .testimonial-slide {
        flex: 0 0 100%;
    }
    
    .testimonial-card {
        padding: 2rem 1.5rem;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }

    .testimonials-section {
        padding: 5rem 0;
    }
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 3rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 74, 173, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary-light);
    width: 30px;
    border-radius: 10px;
}

/* Contact Form 7 Integration */
.wpcf7-form {
    display: grid;
    gap: 1.5rem;
}

.wpcf7-form p {
    margin: 0;
}

.wpcf7-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wpcf7-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.wpcf7-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.wpcf7-form input:not([type="submit"]),
.wpcf7-form select,
.wpcf7-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.wpcf7-form input:focus,
.wpcf7-form select:focus,
.wpcf7-form textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.1);
}

.wpcf7-form .wpcf7-submit {
    background: var(--primary-light);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 163, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.wpcf7-form .wpcf7-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 163, 255, 0.4);
    background: var(--primary);
}

/* Row Fix */
.wpcf7-form .form-row-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .wpcf7-form .form-row-mobile {
        grid-template-columns: 1fr;
    }
}

/* Row Fix */
.wpcf7-form .form-row-mobile {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
}

@media (max-width: 768px) {
    .wpcf7-form .form-row-mobile {
        grid-template-columns: 1fr !important;
    }
}

/* Response Messages */
.wpcf7-response-output {
    margin: 1.5rem 0 0 !important;
    padding: 1rem !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    border: none !important;
    background: var(--bg-light) !important;
    color: var(--primary) !important;
}

.wpcf7-form.sent .wpcf7-response-output {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

.wpcf7-spinner {
    display: block;
    margin: 10px auto 0;
}

/* WordPress Dynamic Menu Support */
.nav-links .menu-item {
    position: relative;
    list-style: none;
}

.nav-links .menu-item a {
    color: var(--white);
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

#header.scrolled .nav-links .menu-item a {
    color: var(--primary);
}

.nav-links .current-menu-item > a,
.nav-links .menu-item a:hover {
    color: var(--primary-light) !important;
}

/* Sub-menu styling */
.nav-links .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow);
    border-radius: 15px;
    padding: 1rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-links .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-links .sub-menu .menu-item {
    display: block;
}

.nav-links .sub-menu .menu-item a {
    color: var(--primary) !important;
    padding: 0.8rem 2rem !important;
    display: block;
    font-size: 0.95rem;
}

.nav-links .sub-menu .menu-item a:hover {
    background: var(--bg-light);
    color: var(--primary-light) !important;
}

/* Footer Menu Styling */
.footer-links .menu, 
.footer-services .menu {
    list-style: none;
    margin-top: 1.5rem;
}

.footer-links .menu-item, 
.footer-services .menu-item {
    margin-bottom: 0.8rem;
}

.footer-links .menu-item a, 
.footer-services .menu-item a,
.footer-menu li a {
    color: var(--white);
    transition: var(--transition);
}

.footer-links .menu-item a:hover, 
.footer-services .menu-item a:hover,
.footer-menu li a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

/* Footer Dynamic Menus */
.footer-menu {
    margin-top: 1.5rem;
    list-style: none;
    padding: 0;
    color: var(--white);
}

.footer-menu li {
    margin-bottom: 0.8rem;
}

.footer-menu i {
    color: var(--primary-light);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Mobile Menu Overrides for WP Menus */
@media (max-width: 768px) {
    .nav-links .menu {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links .menu-item a {
        color: var(--primary) !important;
        padding: 1rem 0;
        width: 100%;
        display: block;
    }

    .nav-links .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 1.5rem;
        display: none;
    }

    .nav-links .menu-item-has-children.active > .sub-menu {
        display: block;
    }
}
