/* =========================================
   JGRE Website - Premium Design System
========================================= */

:root {
    /* Color Palette */
    --primary-blue: #0A3D62;
    /* Deep Industrial Blue */
    --primary-blue-light: #166099;
    --accent-green: #27AE60;
    /* Energy/Eco Green */
    --accent-green-hover: #219653;

    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --bg-dark: #121212;
    --text-dark: #2C3E50;
    --text-gray: #556B8D;
    --text-light: #F8F9FA;

    --border-color: #E2E8F0;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout & Spacing */
    --max-width: 1400px;
    --section-padding: 5rem 1rem;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;

    /* Transitions & Shadows */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease-in-out;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* =========================================
   Reset & Base Styles
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-gray);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 992px) {
    .container {
        padding: 0 4.5rem;
        /* ~3 tabs space */
    }
}

.section {
    padding: var(--section-padding);
    scroll-margin-top: 80px;
    /* Offset for the fixed navbar */
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-dark {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.bg-dark p {
    color: #A0AEC0;
}

.text-center {
    text-align: center;
}

.text-white {
    color: var(--text-light) !important;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* =========================================
   Buttons
========================================= */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-green);
    color: var(--bg-white);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--bg-white);
    transform: translateY(-2px);
}

.hero .btn-secondary {
    border-color: var(--bg-white);
    color: var(--bg-white);
}

.hero .btn-secondary:hover {
    background-color: var(--bg-white);
    color: var(--primary-blue);
}

/* =========================================
   Navigation
========================================= */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    padding: 1rem 0;
}

#navbar .container {
    max-width: 1600px;
    /* Reduced space before on wide screens */
    padding: 0 2rem;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Stardos Stencil', cursive;
    font-weight: 800;
    font-size: 2.2rem;
    color: var(--primary-blue);
    line-height: 1;
}

.logo-subtext {
    font-family: 'Stardos Stencil', cursive;
    font-weight: 400;
    font-size: 1.15rem;
    color: var(--primary-blue);
    margin-top: 0.2rem;
    letter-spacing: 0.5px;
    padding-left: 2px;
}

.logo-j {
    color: var(--accent-green);
    font-family: 'Stardos Stencil', cursive;
    font-size: 2.6rem;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.logo-icon {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-left: -8px;
    /* Offset internal image padding */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--primary-blue);
    position: relative;
}

.nav-links a:not(.btn-primary)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-green);
    transition: var(--transition-fast);
}

.nav-links a:not(.btn-primary):hover::after {
    width: 100%;
}

.mobile-controls {
    display: none;
    align-items: center;
    gap: 1rem;
}

.global-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1px solid #E74C3C;
    color: #E74C3C;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.desktop-global {
    display: inline-block;
}

.mobile-global {
    display: none;
}

.global-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.global-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

.global-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    background-color: var(--bg-white);
    min-width: 190px;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius-sm);
    z-index: 1001;
    overflow: hidden;
    flex-direction: column;
}

.global-dropdown-content.show {
    display: flex;
    animation: fadeIn 0.2s ease-out forwards;
}

.dropdown-header {
    padding: 1rem 1.2rem 0.4rem 1.2rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-blue);
    font-family: var(--font-body);
}

.dropdown-item {
    padding: 0.6rem 1.2rem;
    color: #444;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.flag-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.dropdown-item span:not(.flag-icon) {
    padding-left: 0;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
    color: var(--accent-green);
}

.dropdown-item:hover span:not(.flag-icon) {
    color: var(--accent-green);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-blue);
    transition: 0.3s;
}

/* =========================================
   Hero Section
========================================= */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1466611653911-95081537e5b7?q=80&w=2670&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    color: var(--bg-white);
    text-align: center;
    padding-top: 80px;
    /* Offset nav */
    overflow: hidden;
    /* Ensure video doesn't spill out */
}

/* Background Video Styling */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%) scale(1.05);
    /* hide blurred edges */
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    /* Prevent video from catching clicks */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(-50%, -50%, 0) scale(1.05);
}

/* .hero-boiler custom overlay removed to use standard transparency */

.hero-boiler {
    background-image: none;
    /* Video takes over */
    background-color: var(--primary-dark);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 25, 45, 0.7) 0%, rgba(8, 25, 45, 0.5) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 1s ease-out forwards;
}

.hero .subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-green);
    margin-bottom: 1rem;
}

.hero .title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero .highlight {
    color: var(--accent-green);
}

.hero .description {
    font-size: 1.2rem;
    color: #E2E8F0;
    margin-bottom: 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Clients / Marquee
========================================= */
#clients {
    position: relative;
    padding: 3rem 0;
}

#clients .container,
#clients .marquee-container {
    position: relative;
    z-index: 1;
}

/* CSS Marquee */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    margin-top: 3rem;
}

.marquee-track {
    display: flex;
    gap: 30px;
    width: max-content;
    animation: marquee-scroll 75s linear infinite;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 15px));
    }
}

.marquee-track .client-item {
    flex-shrink: 0;
}

.glass-section .section-title {
    color: var(--bg-white);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3rem;
    letter-spacing: -0.5px;
}

.glass-section .section-title::after {
    background-color: #D4AF37;
    /* Elegant golden color matching the 'Why us' underline */
    height: 2px;
    width: 70px;
}

/* =========================================
   About Section
========================================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-blue);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-green);
    border-radius: 2px;
}

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.section-subtitle {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 1.5rem 0 1rem;
}

.feature-list {
    list-style: none;
    margin-top: 1.5rem;
}

.feature-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: var(--text-dark);
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

.about-branches {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.branch-card {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    border-left: 4px solid var(--primary-blue);
    transition: var(--transition-normal);
}

.glass-section .branch-card {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left-color: var(--accent-green);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.branch-card:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.branch-card h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.branch-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* =========================================
   Services Section (Cards) - Premium Glassmorphism
========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    grid-auto-flow: dense;
}

.service-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 2rem 1.8rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Span styling removed for uniformity */

.service-card::before {
    display: none;
}

.service-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(31, 100, 255, 0.3);
}

.icon-box {
    font-size: 2.2rem;
    margin-bottom: 0;
    flex-shrink: 0;
    color: var(--accent-green);
    filter: drop-shadow(0 0 8px rgba(39, 174, 96, 0.4));
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-watermark {
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.04);
    z-index: -1;
    transition: all 0.5s ease;
    transform: rotate(-10deg);
}

.service-card:hover .icon-watermark {
    color: rgba(255, 255, 255, 0.08);
    transform: rotate(0deg) scale(1.1);
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
    color: #fff;
    font-weight: 600;
}

.service-card p {
    font-size: 0.9rem;
    color: #b0c4de;
    line-height: 1.4;
    margin: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    width: 100%;
}

.service-list {
    list-style: none;
    margin-top: 0.8rem;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.service-list li {
    font-size: 0.9rem;
    color: #b0c4de;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
}

.text-accent {
    color: var(--accent-green);
    font-size: 1.1rem;
}

/* Glass Section Overall Background Wrapper */
.glass-section {
    background-color: #0b1a2a;
    background-image: radial-gradient(circle at center, rgba(16, 40, 70, 0.8) 0%, rgba(5, 12, 20, 1) 100%);
    background-attachment: fixed;
    position: relative;
    color: #fff;
}

.glass-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="20" height="20" fill="none"/><circle cx="2" cy="2" r="1" fill="rgba(255,255,255,0.03)"/></svg>') repeat;
    z-index: 0;
}

.glass-section .container {
    position: relative;
    z-index: 1;
}

.glass-section .section-title,
.glass-section .section-subtitle,
.glass-section .feature-list li {
    color: #fff;
}

.glass-section .section-header p {
    color: #b0c4de;
}


/* =========================================
   Products / Spares Section
========================================= */
.spares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.spare-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
    font-weight: 500;
    color: #fff;
    transition: var(--transition-fast);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.spare-item.has-image {
    padding: 0;
}

.spare-item-label {
    padding: 0.75rem 0.5rem;
    width: 100%;
}

.spare-img-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: white;
}

.spare-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.spare-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-green);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* =========================================
   Clients / Marquee
========================================= */
.clients-swiper {
    width: 100%;
    padding: 1rem 0;
}

.marquee-track {
    align-items: center;
}

.marquee-track .client-item {
    width: 200px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
    transition: var(--transition-normal);
}

.marquee-track .client-item:hover {
    transform: scale(1.05);
}

.client-icon {
    width: 100%;
    height: 100%;
    object-fit: fill;
    /* Changed from contain to fill to fit frame on all sides */
    transition: var(--transition-normal);
    color: transparent;
    /* Hides the alt text if image is broken */
    position: relative;
}

.client-icon::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
}

.client-name {
    display: flex;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e3a5f;
    /* Deep navy for contrast on white */
    text-align: center;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

/* Hide the name ONLY if an image logo is present */
.client-icon+.client-name {
    display: none;
}

/* =========================================
   Project Gallery
========================================= */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* =========================================
   Footer / Contact
========================================= */
.grid-footer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.footer {
    background-color: var(--bg-light);
    padding-top: 5rem;
}

.footer-contact h3 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

.footer-contact p {
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.footer-contact a:hover {
    color: var(--accent-green);
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* =========================================
   Responsive queries
========================================= */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .hero {
        background-attachment: scroll;
    }

    .grid-2,
    .grid-footer {
        grid-template-columns: 1fr;
    }

    .section-title::after {
        left: 0;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .glass-section .section-title {
        font-size: 2.2rem;
    }

    .hero-boiler {
        background-image: url('assets/homepage_mob.png');
        background-position: left center;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .spares-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .service-card {
        padding: 0.8rem 0.5rem;
        border-radius: var(--border-radius-sm);
        gap: 0.5rem;
        min-height: auto;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .icon-box {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .service-card h3 {
        font-size: 0.8rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .service-card p {
        font-size: 0.7rem;
        line-height: 1.2;
        margin-bottom: 0;
    }

    .service-list {
        padding-left: 0.2rem;
        gap: 0.3rem;
        margin-top: 0.3rem;
    }

    .service-list li {
        font-size: 0.7rem;
        line-height: 1.2;
        gap: 0.3rem;
        align-items: flex-start;
    }

    .text-accent {
        font-size: 0.8rem;
        margin-top: 0.1rem;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: 0.4s ease-in-out;
        z-index: -1;
    }

    .desktop-global {
        display: none !important;
    }

    .mobile-global {
        display: inline-block !important;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        z-index: 1000;
    }

    .mobile-controls {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-btns {
        flex-direction: column;
    }

    .hero .title {
        font-size: 2.5rem;
    }

    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .gallery-item {
        border-radius: 8px;
    }
}

@media (max-width: 576px) {
    .logo {
        font-size: 1.6rem;
    }

    .logo-icon {
        height: 38px;
    }

    .logo-subtext {
        font-size: 0.85rem;
    }
}