/* Global box-sizing for consistent layout */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Global Styles --- */
html, body {
    background: linear-gradient(to bottom, #6b7280, #374151);
    color: white;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}
body {
    padding-top: 150px; /* For top-bar (100px) + top-menu (~50px) */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-grow: 1;
}

/* Header Styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    margin: 0;
    padding: 2rem 0;
    text-align: center;
    background-color: rgba(100, 116, 139, 0.9);
    backdrop-filter: blur(10px);
}
.header-content {
    width: 80%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}
header h1 {
    font-size: 1.75rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 1rem;
}
header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 1rem;
}
.call-now-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}
.fortified-roof-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #d1d5db;
    text-align: center;
    margin: 2rem 0;
}
@media (min-width: 640px) {
    header h1 { font-size: 2.5rem; }
    header h2 { font-size: 1rem; }
    .call-now-title { font-size: 1.5rem; }
    .fortified-roof-title { font-size: 1.75rem; }
}
@media (min-width: 768px) {
    header h1 { font-size: 3rem; }
    header h2 { font-size: 1rem; }
    .call-now-title { font-size: 1.75rem; }
    .fortified-roof-title { font-size: 2rem; }
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: #D0A97A;
    padding: 10px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 100px;
    color: #000000;
}
.top-bar-branding {
    font-weight: 600;
    font-size: 1rem;
    margin-left: 15px;
    white-space: nowrap;
}
.top-bar-logo {
    max-height: 65px;
    width: auto;
    margin-left: 10px;
}
.top-bar-phone-link {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.top-bar-phone-link:hover {
    color: #22c55e;
}
.top-bar-cta-button {
    background-color: #22c55e;
    color: white;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}
.top-bar-cta-button:hover {
    background-color: #1a994a;
}
.top-bar-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-start;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

/* Mobile Top Bar */
@media (max-width: 767px) {
    .top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 5px 10px;
    }
    .top-bar-branding,
    .top-bar-cta-button {
        display: none;
    }
    .top-bar-phone-link {
        margin-left: auto;
        font-size: 0.9rem;
    }
    .top-bar-logo {
        max-height: 30px;
    }
    body {
        padding-top: 100px; /* top-bar (~60px) + top-menu (~40px) */
    }
}

/* Top Menu - FIXED VERSION */
.top-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0 10px;
    margin: 0;
    background-color: #000000;
    width: 100%;
    position: fixed;
    top: 100px; /* Below top-bar (100px) + gap */
    left: 0;
    z-index: 1001;
    min-width: fit-content;
}

.top-menu li {
    position: relative;
    margin-right: 15px;
}

.top-menu li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    min-height: 44px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.top-menu li a:hover,
.top-menu li a.active {
    background-color: #000000;
    color: #22c55e;
    border-bottom: 2px solid #22c55e;
}

/* Submenu Styles - FIXED */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #000000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 250px;
    z-index: 1002;
    border-radius: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.submenu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.submenu li {
    display: block;
    width: 100%;
    position: relative;
    border-bottom: 1px solid #333;
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu li a {
    color: #ffffff;
    padding: 12px 15px;
    border-bottom: none;
    font-size: 0.9rem;
}

.submenu li a:hover {
    background-color: #333;
    color: #22c55e;
    border-bottom: none;
}

/* Third Level Menu Styles - FIXED */
.third-level-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 2px;
    background-color: #000000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 200px;
    z-index: 1003;
    border-radius: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.third-level-menu.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.third-level-menu li {
    border-bottom: 1px solid #333;
}

.third-level-menu li:last-child {
    border-bottom: none;
}

.third-level-menu li a {
    color: #ffffff;
    padding: 10px 15px;
    font-size: 0.85rem;
}

.third-level-menu li a:hover {
    background-color: #333;
    color: #22c55e;
}

/* Desktop Hover Behavior */
@media (min-width: 1025px) {
    .top-menu li:hover > .submenu {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    
    .submenu li:hover > .third-level-menu {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Menu Adjustments - FIXED */
@media (max-width: 767px) {
    .top-menu {
        top: 55px; /* Mobile gets reduced top position */
        padding: 0 2px;
        overflow-x: auto;
        overflow-y: hidden;
        min-width: 100%;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .top-menu::-webkit-scrollbar {
        display: none;
    }
    
    .top-menu li {
        margin-right: 3px;
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .top-menu li a {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-height: 36px;
        white-space: nowrap;
        display: flex;
        align-items: center;
    }
}

/* Tablet/iPad Menu Adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .top-menu {
        top: 90px; /* Full top-bar height + gap */
        padding: 0 10px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .top-menu::-webkit-scrollbar {
        display: none;
    }
    
    .top-menu li {
        margin-right: 8px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .top-menu li a {
        font-size: 0.9rem;
        padding: 8px 12px;
        min-height: 44px;
        white-space: nowrap;
        display: flex;
        align-items: center;
    }
}

/* Common submenu styles for touch devices */
@media (max-width: 1024px) {
    .submenu,
    .third-level-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background-color: #1a1a1a;
        transform: none;
        border: none;
        border-top: 1px solid #333;
        white-space: normal;
    }
    
    .submenu {
        margin-left: 0;
    }
    
    .third-level-menu {
        background-color: #2a2a2a;
        margin-left: 20px;
    }
    
    .submenu li a,
    .third-level-menu li a {
        white-space: normal;
        font-size: 0.85rem;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .top-menu li a {
        font-size: 0.7rem;
        padding: 5px 6px;
        min-height: 32px;
    }
    
    .submenu li a,
    .third-level-menu li a {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* Features, Contact Form, Footer styles (unchanged) */
#features { margin-bottom: 50px; }
#features .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}
@media (min-width: 640px) {
    #features .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    #features .grid { grid-template-columns: repeat(3, 1fr); }
}
.feature-card {
    background-color: rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.5);
    min-height: 150px;
}
.feature-card:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.03);
    border-color: rgba(59, 130, 246, 0.3);
}
.feature-card .icon-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.feature-card svg {
    width: 2rem;
    height: 2rem;
    color: #60a5fa;
}
.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}
.feature-card p {
    color: #d1d5db;
    margin-bottom: 1rem;
}
.feature-card li {
    color: #E0E0E0;
    list-style-type: disc;
}
.feature-card button {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    width: 100%;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    border: none;
}
.feature-card button:hover {
    color: #3b82f6;
    background-color: rgba(96, 165, 250, 0.3);
}
.city-list {
    background-color: rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.5);
    min-height: 150px;
    width: 80%;
    margin: 0 auto 2rem;
}
.city-list p {
    color: #d1d5db;
    margin-bottom: 1rem;
}
.city-list p.bold-text {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.city-list ul {
    color: #E0E0E0;
    list-style-type: disc;
    padding-left: 1.5rem;
}
.city-list li {
    color: #E0E0E0;
}
.service-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 2rem;
}
.service-image-container img {
    max-width: 100%;
    height: auto;
    width: 80%;
    border-radius: 8px;
    display: block;
}
.feature-card2 {
    background-color: rgba(100, 116, 139, 0.8);
    backdrop-filter: blur(10px);
    width: 80%;
    margin: 0 auto 2rem;
    padding: 10px;
    border-radius: 8px;
    color: white;
    text-align: left;
    min-height: 150px;
}
.feature-card2:last-child {
    margin-bottom: 0;
}
.feature-card2 p.bold-text {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.feature-card2 a {
    color: #60a5fa;
    text-decoration: none;
}
.feature-card2 a:hover {
    color: #3b82f6;
    text-decoration: underline;
}
.feature-card3 {
    background-color: rgba(100, 116, 139, 0.8);
    width: 95%;
    padding: 10px;
    border-radius: 8px;
    color: white;
    text-align: left;
}
.feature-card3 li {
    color: #E0E0E0;
    font-weight: normal;
    list-style-type: disc;
    padding-left: 30px;
}
.feature-card3 ol {
    list-style-position: inside;
    color: white;
    font-weight: bold;
    list-style-type: decimal;
}
.main-content-layout {
    flex-grow: 1;
    width: 100%;
}
.ready-section {
    background-color: rgba(100, 116, 139, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 50px;
}
.ready-section h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}
@media (min-width: 640px) {
    .ready-section h1 { font-size: 2.5rem; }
}
@media (min-width: 768px) {
    .ready-section h1 { font-size: 3rem; }
}
.ready-section p {
    font-size: 1rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    max-width: 60%;
    margin: 0 auto;
}
.ready-section button {
    background-image: linear-gradient(to right, #8b5cf6, #3b82f6);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 1rem;
    border: none;
}
.ready-section button:hover {
    background-image: linear-gradient(to right, #6d28d9, #2563eb);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}
#contact-form {
    margin: 5rem auto 100px;
    width: 80%;
    max-width: 600px;
}
@media (max-width: 767px) {
    #contact-form {
        max-width: 75%;
        margin-left: 10px;
    }
}
form {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 40rem;
}
input[type="text"],
input[type="email"],
textarea {
    width: calc(100% - 2rem);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
textarea {
    min-height: 10rem;
    resize: vertical;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}
button[type="submit"] {
    background-color: #4a5568;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-block;
    width: auto;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
button[type="submit"]:hover {
    background-color: #2d3748;
}
footer {
    background-color: #D0A97A;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    text-align: center;
    padding: 25px;
    width: 100%;
    color: #000000;
    font-size: .85rem;
}
footer a:link, footer a:visited {
    color: #000000;
    font-size: .85rem;
    text-decoration: none;
}
footer a:hover {
    color: #ffffff;
    font-size: .9rem;
}
footer p {
    color: #000000;
    font-size: .85rem;
    text-align: center;
}
footer p2 {
    text-decoration: underline;
    font-size: 1rem;
    text-align: start;
}
footer img {
    width: 30px;
}
footer ul {
    list-style-type: none;
    color: #000000;
    font-size: .85rem;
    text-align: start;
    padding-inline-start: 10px;
}
footer div {
    margin: 0 5px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
footer div:not(:first-child) {
    border-left: 1px solid #000000;
}
@media (max-width: 767px) {
    .container { max-width: 100%; padding: 0 0.5rem; }
    .service-image-container img { width: 95%; }
    .city-list { width: 95%; }
    header { padding: 2rem 0; }
    .header-content { padding: 0 0.5rem; }
    footer {
        flex-direction: column;
        padding: 20px 0;
        height: auto;
    }
    footer div {
        border-left: none;
        border-right: none;
        border-bottom: 1px solid #000000;
        padding: 15px 10px;
        width: 100%;
        margin: 0;
    }
    footer div:last-child { border-bottom: none; }
    footer p2, footer li { text-align: center; }
}