/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(8px); /* This adds blur behind the modal */
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.close-button {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #E41B23;
}

.modal h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group select,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #E41B23;
    box-shadow: 0 0 5px rgba(255, 140, 0, 0.2);
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #E41B23;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #C41820;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20px auto;
        padding: 20px;
    }
}

.blur {
    filter: blur(8px);
    transition: filter 0.3s ease;
}

.form-group input:invalid:focus,
.form-group select:invalid:focus,
.form-group textarea:invalid:focus {
    border-color: #ff3333;
    box-shadow: 0 0 5px rgba(255, 51, 51, 0.2);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ff3333;
    background-color: #fff2f2;
}

.form-group.valid input,
.form-group.valid select,
.form-group.valid textarea {
    border-color: #28a745;
    background-color: #f8fff9;
}

.error-message {
    color: #ff3333;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

@media (max-width: 768px) {
    .Header {
        padding: 10px;
        flex-direction: column;
    }

    .Nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .Nav li {
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }

    .phone-link, .quote-button {
        margin: 5px 0;
        width: 100%;
    }

    .Logo img {
        max-width: 200px;
    }
}

/* Hamburger menu styles */
.hamburger-menu {
    display: none;
    cursor: pointer;
    z-index: 1000;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: 0.4s;
}

/* Mobile styles */
@media (max-width: 768px) {
    .Header {
        position: relative;
        padding: 15px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    .Logo {
        padding-left: 0;
        flex: 0 0 auto;
        margin-right: auto;
    }

    .hamburger-menu {
        display: block;
        margin-left: auto;
    }

    .Nav {
        position: fixed;
        right: -100%;
        top: 0;
        width: 80%;
        height: 100vh;
        background-color: white;
        padding-top: 70px;
        transition: 0.3s ease;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow: hidden;
    }

    .Nav.active {
        right: 0;
    }

    .Nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
        list-style: none;
    }

    .Nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

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

    .Nav a {
        padding: 15px;
        display: inline-block;
        width: auto;
        text-align: center;
        position: relative;
        color: inherit;
        text-decoration: none;
    }

    /* Hover effect only for non-active links */
    .Nav a:not(.active)::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #E41B23;
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .Nav a:not(.active):hover::after {
        transform: scaleX(1);
    }

    /* Active state styles */
    .Nav a.active {
        color: #E41B23;
        border-bottom: none;  /* Remove any border-bottom */
    }

    .Nav a.active::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #E41B23;
        transform: scaleX(1);  /* Ensure underline is visible */
    }

    .Nav li.phone-link,
    .Nav li.quote-button {
        border-bottom: none;
        margin: 10px 0;
        padding: 0 15px;
    }

    .Nav li.quote-button a {
        margin: 0 auto;
        width: calc(100% - 30px);
    }

    /* Hamburger menu animation */
    .hamburger-menu.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

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

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

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    /* Adjust logo size */
    .Logo img {
        max-width: 150px;
        height: auto;
    }

    /* Style phone and quote buttons */
    .phone-link, .quote-button {
        margin: 10px 0;
    }

    .phone-link a, .quote-button a {
        display: block;
        padding: 10px;
    }
}

/* Base styles for mobile-first approach */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding-top: 110px; /* Logo height + padding */
    overflow-x: hidden;
}

/* Header and Navigation */
.Header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: auto; /* Remove fixed height to adapt to content */
}

.Logo {
    display: flex;
    align-items: center;
}

.Logo img {
    height: 80px; /* Adjust this to your desired logo size */
    width: auto;
    display: block; /* Ensures proper image rendering */
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .Nav {
        position: fixed;
        right: -100%;
        top: 0;
        width: 80%;
        height: 100vh;
        background-color: white;
        padding-top: 70px;
        transition: 0.3s ease;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow: hidden;
    }

    .Nav.active {
        right: 0;
    }

    .Nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
        list-style: none;
    }

    .Nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

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

    .Nav a {
        padding: 15px;
        display: inline-block;
        width: auto;
        text-align: center;
        position: relative;
        color: inherit;
        text-decoration: none;
    }

    /* Hover effect only for non-active links */
    .Nav a:not(.active)::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #E41B23;
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .Nav a:not(.active):hover::after {
        transform: scaleX(1);
    }

    /* Active state styles */
    .Nav a.active {
        color: #E41B23;
        border-bottom: none;  /* Remove any border-bottom */
    }

    .Nav a.active::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #E41B23;
        transform: scaleX(1);  /* Ensure underline is visible */
    }

    .Nav li.phone-link,
    .Nav li.quote-button {
        border-bottom: none;
        margin: 10px 0;
        padding: 0 15px;
    }

    .Nav li.quote-button a {
        margin: 0 auto;
        width: calc(100% - 30px);
    }

    /* Improved hamburger menu */
    .hamburger-menu {
        display: block;
        position: fixed;
        right: 20px;
        top: 20px;
        z-index: 1000;
        padding: 10px;
    }

    .bar {
        width: 25px;
        height: 2px;
        margin: 5px 0;
        background-color: #333;
        transition: 0.4s;
    }

    /* Overlay when menu is open */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        z-index: 998;
    }

    body.menu-open::after {
        opacity: 1;
        visibility: visible;
    }

    .Logo img {
        height: 60px; /* Smaller logo for mobile */
    }

    body {
        padding-top: 90px; /* Adjust based on mobile logo size + padding */
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 80px;
    }

    .Header {
        height: 80px;
    }

    .Logo img {
        height: 60px;
    }

    .Nav a {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .Nav li.phone-link {
        text-align: center;
        border-bottom: none;
        margin: 10px 0;
        padding: 0 15px;
    }

    .Nav li.phone-link a {
        display: inline-flex; /* Changed from block to inline-flex */
        justify-content: center;
        align-items: center;
        width: auto;
        margin: 0 auto;
        padding: 10px;
    }

    /* Ensure the phone icon and number stay together */
    .Nav li.phone-link a span {
        margin-left: 5px;
    }
}
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 400px;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.popup.show .popup-content {
    transform: scale(1);
}

.popup-icon {
    width: 60px;
    height: 60px;
    background: #E41B23;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 30px;
}

.close-popup {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.popup h3 {
    color: #333;
    margin-bottom: 10px;
}

.popup p {
    color: #666;
    margin: 0;
}

.Nav a.active {
    color: #E41B23;  /* Highlight active link */
}

@media (max-width: 968px) {
    .Nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 20px 0;
    }

    .Nav.active {
        display: block;
    }

    .Nav ul {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .Nav li {
        margin: 10px 0;
        width: auto;  /* Changed from 100% */
        text-align: center;
    }

    .Nav a {
        display: inline-block;  /* Changed from block */
        width: auto;  /* Changed from 100% */
        padding: 10px 20px;  /* Adjusted padding */
        text-align: center;
    }

    /* Ensure phone link and quote button maintain their styles */
    .Nav li.phone-link a,
    .Nav li.quote-button a {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: auto;
        margin: 0 auto;
    }
}
