/* Root Variables */
:root {
    --primary-color: #0a362a;
    --logo-color: #0e4c3b;
    --background-color: #ecf0f1;
    --text-color: #333;
    --light-gray: #bdc3c7;
    --white: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
}

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

/* Header & Navigation */
#main-header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 45px;
    width: auto;
}

.main-nav > ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.main-nav a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.6rem 1rem;
    display: block;
    transition: background-color 0.3s;
}

.main-nav a:hover {
    background-color: var(--background-color);
    border-radius: 4px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    min-width: 180px;
    z-index: 1001;
}

/* Show on hover for desktop */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

.dropdown-menu a {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding-right: 1rem;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all 0.3s;
}

.main-nav.nav-active .hamburger-menu span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

.main-nav.nav-active .hamburger-menu span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Reusable Components --- */

/* CTA Buttons */
.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-button-secondary {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: transform 0.3s;
}

.cta-button-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Product Card Component */
.product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.product-card-info {
    padding: 1rem;
}

.product-card-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.product-card-info p {
    margin: 0;
    font-size: 0.9rem;
}

/* --- End Reusable Components --- */

/* NEW: Mobile Bottom Bar */
.mobile-bottom-bar {
    display: none; /* Hidden by default, shown via JavaScript */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--white);
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1500;
}

.mobile-quote-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s;
}

.mobile-quote-button:hover {
    background-color: var(--logo-color);
}

/* Adjust body padding when mobile bar is visible */
@media (max-width: 768px) {
    body.has-mobile-bar {
        padding-bottom: 80px; /* Adjust based on bar height */
    }
}
/* END NEW */

/* UPDATED: Modal (Lightbox) Styles with Navigation */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.85); /* Black w/ opacity */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease-in-out;
    position: relative;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
}

/* NEW: Modal Navigation Arrows */
.modal-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.8);
    color: var(--primary-color);
    border: none;
    padding: 1rem 1.2rem;
    cursor: pointer;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.3s;
    z-index: 2001;
    display: none; /* Hidden by default, shown via JavaScript when multiple images */
}

.modal-nav-arrow:hover {
    background-color: rgba(255,255,255,0.95);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev-arrow {
    left: 20px;
}

.modal-next-arrow {
    right: 20px;
}

/* Mobile adjustments for modal navigation */
@media (max-width: 768px) {
    .modal-nav-arrow {
        padding: 0.8rem 1rem;
        font-size: 1.5rem;
    }
    
    .modal-prev-arrow {
        left: 10px;
    }
    
    .modal-next-arrow {
        right: 10px;
    }
    
    .close-modal {
        right: 20px;
        font-size: 35px;
    }
}
/* END UPDATED */

/* Footer */
#main-footer {
    background-color: var(--primary-color);
    color: #e9e9e9;
    text-align: center;
    padding: 1rem 0;
}

/* Mobile Responsive - Common */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .main-nav > ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        text-align: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    .main-nav.nav-active > ul {
        max-height: 500px;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background-color: #f8f9fa;
        padding: 0.25rem 0 0.5rem 1rem; /* Indent the sub-menu */
        border-radius: 0;
    }

    .dropdown.mobile-dropdown-open > .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        font-size: 0.9em;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    .hamburger-menu {
        display: block;
    }
}