/* --- CSS Variables & Reset --- */
:root {
    --primary: #104c97;
    --primary-dark: #0c3a75;
    --secondary: #1e60b0;
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f9fafb;
    /* Gray-50 */
    --text-main: #333333;
    --text-muted: #6b7280;
    /* Gray-500 - Slightly darker for better readability */
    --text-light: #ffffff;
    --border-color: #e5e7eb;
    /* Gray-200 */
    --hero-overlay: rgba(16, 76, 151, 0.45);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --container-width: 1280px;
}

/* Dark Mode Overrides */
html.dark :root {
    --primary: #60a5fa;
    /* Brighter blue for primary actions in dark mode */
    --primary-dark: #3b82f6;
    --bg-body: #0f172a;
    /* Slate-900 for deeper background */
    --bg-surface: #1e293b;
    /* Slate-800 for surface depth */
    --bg-surface-alt: #334155;
    /* Slate-700 for highlighting */
    --text-main: #f1f5f9;
    /* Slate-100 for high contrast */
    --text-muted: #94a3b8;
    /* Slate-400 for secondary text */
    --border-color: #334155;
    /* Slate-700 for subtle borders */
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.5;

}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

/* --- Utilities --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

.block {
    display: block;
}

/* --- Top Bar --- */
.top-bar {
    background-color: #104c97;
    /* Always dark blue, even in dark mode */
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info,
.top-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-quote {
    background-color: #0c3a75;
    padding: 0.5rem 1.5rem;
    margin-left: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-quote:hover {
    background-color: #082a55;
}

@media (max-width: 767px) {
    .top-bar .container {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem;
    }

    .email-item,
    .top-links {
        display: none !important;
    }

    .contact-info {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .phone-item {
        font-weight: 500;
    }
}

/* --- Header --- */
header {
    background-color: var(--bg-surface);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s;
    /* padding: 0.5rem 0; */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 1000;
    font-size: 1.5rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    height: 65px;
}

.logo-icon img {
    height: 100%;
    width: auto;
}

.main-nav {
    display: none;
    /* Hidden on mobile by default */
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 100;
    gap: 1.5rem;
    font-weight: 700;
}

.main-nav.mobile-open {
    display: flex;
}

.main-nav a:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }

    .main-nav {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        padding: 0;
        box-shadow: none;
        gap: 2rem;
        background: transparent;
    }
}

.mobile-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 767px) {
    .mobile-search-btn {
        display: flex;
    }

    .search-wrapper {
        display: none;
        width: 100%;
        margin-top: 1rem;
        position: relative;
    }

    .search-wrapper.mobile-visible {
        display: block;
    }

    header .container {
        justify-content: space-between;
        gap: 0.25rem;
    }
}

@media (max-width: 400px) {
    .logo-icon {
        height: 50px;
    }

    .container {
        padding: 0 0.75rem;
    }
}

@media (max-width: 350px) {
    .logo-icon {
        height: 42px;
    }

    .container {
        padding: 0 0.5rem;
    }

    .logo-area {
        gap: 0.25rem;
    }
}


.search-input {
    width: 100%;
    background-color: #f3f4f6;
    /* Gray-100 */
    color: #374151;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    padding-right: 2.5rem;
    outline: none;
}

html.dark .search-input {
    background-color: #1f2937;
    /* Gray-800 */
    color: #d1d5db;
}

.search-input:focus {
    box-shadow: 0 0 0 2px var(--primary);
}

.search-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.search-btn:hover {
    color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Ensure minimum height for desktop to fit everything */
    min-height: 600px;
}

/* Solid blue bar at the bottom of hero - and spacing for cards */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: #104c97;
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: #0b326667;
    /* Reduced opacity for better image visibility */
    mix-blend-mode: normal;
}

html.dark .hero-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    /* Slightly more visible image in dark mode too */
    mix-blend-mode: normal;
}

.hero-content {
    /* Removed absolute positioning for centered flow */
    position: relative;
    z-index: 25;
    /* Above feature cards (z-index: 20) */
    text-align: center;
    color: white;
    width: 100%;
    padding: 0 1rem;
    /* Basic padding, will increase for desktop to avoid cards */
    margin-top: 4rem;
    margin-bottom: 4rem;
}

@media (max-width: 767px) {
    .hero-content {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        padding: 4rem 1rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem !important;
        margin-bottom: 1.0rem;
        font-weight: 400;
    }

    .hero-title strong {
        font-weight: 500;
    }

    /* .hero-overlay display:none removed */

    /* Button overrides removed to use default white/outline styles */
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    border-radius: 0.125rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-white {
    background-color: white;
    color: #104c97;
}

.btn-white:hover {
    background-color: #f3f4f6;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* --- Floating Feature Cards (Desktop) --- */
.hero-features-desktop {
    display: none;
    /* Hidden on mobile */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* transform: translateY(65%); Removed to keep inside hero */
    z-index: 20;
    /* Higher than blue bar */
    /* padding-bottom: 2rem; */
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    /* Distinct gap between cards */
    /* box-shadow removed from container, moved to cards */
}

.feature-card {
    background-color: var(--bg-surface);
    padding: 1.25rem 1rem;
    /* Balanced padding for compact look */
    display: flex;
    flex-direction: column;
    /* Stack image and text vertically */
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Center text */
    gap: 0.75rem;
    /* Balanced gap */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    /* Ensure uniform height */
    box-shadow: var(--shadow);
    /* Softer card shadow */
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Border between cards removed for gap style */
/* .feature-card:not(:last-child) { border-right: ... } */

.feature-card:hover {
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.feature-icon {
    margin-bottom: 0.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.feature-image {
    width: 100%;
    /* Maximize width usage */
    height: 220px;
    /* Reduced height for compact look */
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover .feature-image {
    transform: scale(1.1);
    /* Subtle pop effect */
}

.feature-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-text h3 {
    font-size: 1.25rem;
    /* More compact title */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.2;
}

.feature-text p {
    font-size: 0.9rem;
    /* Slightly smaller text for balance */
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    max-width: 95%;
}

/* --- Mobile Features Section --- */
.mobile-features {
    padding: 3rem 0;
    background-color: var(--bg-surface-alt);
}

.mobile-card {
    background-color: var(--bg-surface);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.mobile-card:active {
    transform: scale(0.98);
    background-color: var(--bg-surface-alt);
}

.mobile-card .feature-icon {
    margin-bottom: 0.75rem;
}

.mobile-card .feature-image {
    height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.mobile-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.mobile-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}



/* --- Footer --- */
footer {
    background-color: #0b3366;
    color: white;
    padding: 3rem 0;
}

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

.footer-col h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-col p,
.footer-col li {
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.footer-col a:hover {
    color: white;
}

.newsletter-form {
    display: flex;
}

.newsletter-form input {
    padding: 0.5rem;
    border-radius: 4px 0 0 4px;
    border: none;
    width: 100%;
    color: black;
}

.newsletter-form button {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.newsletter-form button:hover {
    background-color: #2563eb;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #1e40af;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* --- Media Queries --- */
@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
    }
}

@media (min-width: 768px) {
    header .container {
        flex-wrap: nowrap;
    }

    .search-wrapper {
        width: auto;
        margin-top: 0;
        min-width: 250px;
        position: relative;
        display: block;
    }

    .search-btn {
        display: none;
    }

    .search-input {
        padding-right: 1rem;
    }

    .main-nav {
        display: flex;
        /* Handled above by consolidated mq */
    }

    .hero-title {
        font-size: 3.75rem;
    }

    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .hero {
        /* Reserve space at bottom for the floating cards (approx 300px) */
        padding-bottom: 280px;
        min-height: 850px;
    }

    .hero-features-desktop {
        display: block;
    }

    .mobile-features {
        display: none;
    }

    .hero-content {
        text-align: left;
        margin-top: 0;
        margin-bottom: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}

/* --- Product Modal (Keeping generic classes for new pages if needed) --- */
.product-page-content {
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.product-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    text-align: center;
}

.video-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video,
.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 800px;
}

.gallery-item {
    aspect-ratio: 1;
    background-color: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details {
    max-width: 800px;
    text-align: left;
    margin-top: 2rem;
}

.product-details h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.product-details p,
.product-details li {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.product-details ul {
    padding-left: 1.5rem;
    list-style: disc;
}

/* --- Product Specs Table --- */
.product-specs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

.product-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: var(--text-main);
    min-width: 300px;
}

.product-specs-table td {
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: background-color 0.2s;
}

/* .product-specs-table tr:hover td {
    background-color: rgba(16, 76, 151, 0.05);
} */

html.dark .product-specs-table tr:hover td {
    background-color: rgba(96, 165, 250, 0.1);
}

.product-specs-table tr td:first-child {
    font-weight: 700;
    width: 35%;
    background-color: var(--primary);
    color: white;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-color: var(--primary-dark);
}

html.dark .product-specs-table tr td:first-child {
    background-color: var(--bg-surface-alt);
    color: var(--primary);
    border-color: var(--border-color);
}

/* --- Product Diagram --- */
.product-diagram {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

html.dark .product-diagram {
    background-color: #f8fafc;
    /* Slightly off-white for better dark mode blend */
    opacity: 0.9;
}

.product-diagram img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

/* --- About Header with PDF Button --- */
.about-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.about-header h3 {
    margin-bottom: 0;
    /* Remove default margin to align with button */
    font-size: 1.5rem;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #dc2626;
    /* Red-600 */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-pdf:hover {
    background-color: #b91c1c;
    /* Red-700 */
}

/* --- Product Media Carousel --- */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
}

.carousel-slide video,
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-control.prev {
    left: 1rem;
}

.carousel-control.next {
    right: 1rem;
}

.carousel-control .material-icons {
    font-size: 2rem;
}

/* --- Carousel Thumbnails --- */
.thumbnail-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 600px;
}

.thumbnail-item {
    flex: 1 1 calc(25% - 0.75rem);
    aspect-ratio: 1 / 1;
    min-width: 60px;
    max-width: 140px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.thumbnail-item.hidden-thumbnail {
    display: none;
}

.thumbnail-more {
    flex: 1 1 calc(25% - 0.75rem);
    aspect-ratio: 1 / 1;
    min-width: 60px;
    max-width: 140px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.thumbnail-more:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 76, 151, 0.2);
}

.thumbnail-item:hover {
    border-color: var(--primary-dark);
}

.thumbnail-video-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
}