/* ================================================
   MEEM Website - Main Stylesheet
   Modern Energy Equipment Manufacturing Co., Ltd.
   ================================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Primary Colors - Deep Industrial Blue */
    --primary: #0a2463;
    --primary-dark: #061539;
    --primary-light: #1e3a7a;
    --primary-accent: #3e5898;

    /* Secondary Colors */
    --secondary: #f7931e;      /* Orange accent (industrial) */
    --secondary-dark: #d67d0f;
    --secondary-light: #ffa94d;

    /* Neutral Colors */
    --white: #ffffff;
    --off-white: #f4f6f9;
    --light-gray: #e8ecf1;
    --mid-gray: #8892a4;
    --dark-gray: #3a4553;
    --near-black: #1a1f2c;

    /* Functional Colors */
    --success: #28a745;
    --error: #dc3545;

    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-heading: 'Montserrat', sans-serif;

    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1200px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(10,36,99,0.08);
    --shadow-md: 0 4px 20px rgba(10,36,99,0.12);
    --shadow-lg: 0 8px 40px rgba(10,36,99,0.16);
    --shadow-xl: 0 12px 60px rgba(0,0,0,0.2);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-gray);
    background-color: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul { list-style: none; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

/* ---------- Top Bar ---------- */
.top-bar {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    padding: 8px 0;
    letter-spacing: 0.3px;
}

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

.top-bar a {
    color: var(--secondary);
}
.top-bar a:hover { color: var(--secondary-light); }

.top-bar i { margin-right: 5px; font-size: 0.78rem; }

/* ---------- Construction Notice Bar ---------- */
.construction-notice {
    background: linear-gradient(90deg, #e03131 0%, #f76707 40%, #f76707 60%, #e03131 100%);
    background-size: 200% 100%;
    color: var(--white);
    padding: 14px 0;
    font-size: 0.93rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    position: relative;
    z-index: 1001;
    animation: constructionStripe 3s linear infinite, noticeGlow 2s ease-in-out infinite alternate;
}

@keyframes constructionStripe {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes noticeGlow {
    from { box-shadow: 0 2px 12px rgba(231,49,49,0.3); }
    to   { box-shadow: 0 4px 24px rgba(247,103,7,0.5); }
}

.construction-notice .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.construction-icon {
    display: flex;
    align-items: center;
    animation: pulse 1.5s ease-in-out infinite, iconBounce 0.6s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.5));
}

.construction-icon i {
    font-size: 1.4rem;
}

@keyframes iconBounce {
    from { transform: rotate(-8deg) scale(1); }
    to   { transform: rotate(8deg) scale(1.15); }
}

.construction-text {
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.construction-close {
    position: absolute;
    right: 20px;
    background: rgba(255,255,255,0.22);
    border: 1.5px solid rgba(255,255,255,0.35);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.construction-close:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---------- Header / Navigation ---------- */
.main-header {
    position: fixed;
    top: 32px; /* top bar height */
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.main-header.scrolled {
    background: var(--white);
    box-shadow: var(--shadow-md);
    top: 0;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
}

/* Logo */
.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    z-index: 1001;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 3px;
    transition: var(--transition-normal);
}

/* Logo Image */
.logo-img {
    height: 46px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-normal);
}

.main-header.scrolled .logo-img {
    filter: none;
}

.logo-sub {
    font-size: 1.1rem;
    color:var(--mid-gray);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-top: -2px;
    transition: var(--transition-normal);
}

.main-header.scrolled .logo-text {
    color: var(--primary);
}
.main-header.scrolled .logo-sub {
    color: var(--mid-gray);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu > li > a {
    display: block;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--dark-gray);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: var(--primary);
    background: var(--off-white);
}

.main-header.scrolled .nav-menu > li > a {
    color: var(--dark-gray);
}
.main-header.scrolled .nav-menu > li > a:hover,
.main-header.scrolled .nav-menu > li > a.active {
    color: var(--primary);
    background: var(--off-white);
}

.nav-menu > li > a i {
    font-size: 0.65rem;
    margin-left: 4px;
    transition: var(--transition-fast);
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-normal);
    z-index: 999;
}

.dropdown-wide {
    min-width: 340px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown:hover > a i {
    transform: rotate(180deg);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 22px;
    font-size: 0.87rem;
    color: var(--dark-gray);
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.dropdown-menu li a:hover {
    color: var(--primary);
    background: var(--off-white);
    border-left-color: var(--secondary);
    padding-left: 26px;
}

.btn-nav-contact {
    background: var(--secondary) !important;
    color: var(--white) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
}

.btn-nav-contact:hover {
    background: var(--secondary-dark) !important;
}

.main-header.scrolled .btn-nav-contact {
    color: var(--white) !important;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-toggle span {
    width: 26px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.main-header.scrolled .mobile-toggle span {
    background: var(--primary);
}

/* ---------- Hero Section ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url(../images/factory_visual.webp);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    margin-top: 32px; /* offset for top bar */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10, 36, 99, 0.88) 0%,
        rgba(6, 21, 57, 0.80) 40%,
        rgba(10, 36, 99, 0.70) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 90px;
}

.hero-text {
    max-width: 720px;
    animation: fadeInUp 1s ease forwards;
}

.hero-tagline {
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 18px;
    border-left: 3px solid var(--secondary);
    padding-left: 15px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3.4rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.hero h1 .highlight {
    color: var(--secondary);
}

.hero-description {
    font-size: 1.08rem;
    color: rgba(255,255,255,0.82);
    margin-bottom: 35px;
    line-height: 1.8;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 34px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 2px solid transparent;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-primary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(247,147,30,0.35);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.45);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
    transform: translateY(-2px);
}

.btn-large {
    padding: 17px 44px;
    font-size: 1.05rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Hero Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.hero-scroll-indicator a:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

/* ---------- Section Headers ---------- */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header.light {
    color: var(--white);
}

.section-tag {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.section-header.light .section-tag {
    color: var(--secondary-light);
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.section-header.light h2 {
    color: var(--white);
}

.section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--secondary), var(--primary));
    margin: 0 auto 20px;
    border-radius: 2px;
}

.section-desc {
    max-width: 650px;
    margin: 0 auto;
    color: rgba(255,255,255,0.8);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ---------- About Intro Section ---------- */
.about-intro {
    background: var(--white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-content h3 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-content p {
    font-size: 0.98rem;
    color: var(--dark-gray);
    margin-bottom: 18px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid var(--light-gray);
}

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

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.83rem;
    color: var(--mid-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Frame */
.image-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.image-frame img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: var(--transition-slow);
}

.image-frame:hover img {
    transform: scale(1.04);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10,36,99,0.9));
    color: var(--white);
    padding: 18px 22px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---------- Products Section - Light Theme (Alternating Layout) ---------- */
.products-grid-alt {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
            flex-direction: column;
}

.products-grid-alt .alt-card {
    /* Use margin instead of flex gap for broader Edge compatibility */
    margin-bottom: 48px;
}

.products-grid-alt .alt-card:last-child {
    margin-bottom: 0;
}

/* Each product row */
.alt-card {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 40px 1.15fr;
    grid-template-columns: 1fr 1.15fr;
    gap: 40px;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(10,36,99,0.05);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    /* Critical fix: prevent grid items from overflowing */
    min-width: 0;
}

/* IE/Edge legacy grid gap fallback via margins */
.alt-card > *:nth-child(1) {
    -ms-grid-column: 1;
}
.alt-card > *:nth-child(2) {
    -ms-grid-column: 3;
}

.alt-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

/* Reverse layout for even items (image on right) */
.alt-card-reverse {
    -ms-grid-columns: 1.15fr 40px 1fr;
    grid-template-columns: 1.15fr 1fr;
}

.alt-card-reverse > *:nth-child(1) {
    -ms-grid-column: 1;
}
.alt-card-reverse > *:nth-child(2) {
    -ms-grid-column: 3;
}

/* ---- Visual / Image side ---- */
.alt-card-visual {
    position: relative;
    min-height: 300px;
    /* Prevent grid blowout */
    min-width: 0;
    max-width: 100%;
}

.alt-img-wrapper {
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(145deg, #f0f4f8, #e8eef5);
    /* Ensure image container fills grid cell properly */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.alt-img-wrapper img {
    width: 100%;
    height: 100%;
    min-height: 280px;
    -o-object-fit: cover;
       object-fit: cover;
    -webkit-transition: transform 0.6s ease;
            transition: transform 0.6s ease;
    /* Prevent image overflow in Edge */
    display: block;
}

.alt-card:hover .alt-img-wrapper img {
    transform: scale(1.03);
}

/* Placeholder style for missing images */
.alt-img-wrapper.alt-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(145deg, #f7f9fc, #eceef3);
    border: 2px dashed var(--light-gray);
}

.alt-img-wrapper.alt-placeholder i {
    font-size: 2.4rem;
    color: var(--mid-gray);
    opacity: 0.25;
}

.alt-img-wrapper.alt-placeholder span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mid-gray);
    opacity: 0.35;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Number badge */
.alt-card-badge {
    position: absolute;
    top: -10px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(247,147,30,0.35);
    z-index: 2;
}

.alt-card-reverse .alt-card-badge {
    left: auto;
    right: 20px;
}

/* ---- Body / Text side ---- */
.alt-card-body {
    padding: 8px 0;
    /* Prevent text overflow in Edge grid */
    min-width: 0;
    overflow: hidden;
}

.alt-card-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.alt-card-icon i {
    font-size: 1.2rem;
    color: var(--white);
}

/* Color variants for icons per card */
.alt-card-icon-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
.alt-card-icon-teal {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}
.alt-card-icon-indigo {
    background: linear-gradient(135deg, #6366f1, #4338ca);
}

.alt-card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.alt-card-desc {
    font-size: 0.93rem;
    color: var(--dark-gray);
    line-height: 1.75;
    margin-bottom: 22px;
    opacity: 0.88;
}

/* Specs grid — compact feature pills */
.alt-specs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.alt-spec-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--off-white);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: var(--transition-fast);
}

.alt-spec-item:hover {
    border-left-color: var(--secondary);
    background: #f0f2f6;
}

.alt-spec-item i {
    color: var(--secondary);
    font-size: 0.88rem;
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.alt-spec-item span {
    font-size: 0.84rem;
    color: var(--dark-gray);
    line-height: 1.55;
}

.alt-spec-item strong {
    color: var(--primary);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.82rem;
}

/* ---------- Products Section Light Theme (page-level) ---------- */
.products-section-light {
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 40%, #f5f0eb 100%);
    padding: 90px 0 !important;
}

.products-section-light .section-header h2 {
    color: var(--primary);
}

.products-section-intro {
    max-width: 620px;
    margin: 18px auto 0;
    font-size: 1rem;
    color: var(--mid-gray);
    line-height: 1.7;
}

/* ---------- Tech Specs Bar ---------- */
.tech-specs-bar {
    background: var(--off-white) !important;
}

.tech-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.tech-spec-item {
    text-align: center;
    padding: 28px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tech-spec-item i {
    color: var(--secondary);
    font-size: 1.8rem;
    margin-bottom: 12px;
    display: block;
}

.tech-spec-item strong {
    display: block;
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.tech-spec-item p {
    font-size: 0.85rem;
    color: var(--mid-gray);
}

/* ---------- Page Hero Variants ---------- */
.hrsg-hero {
    margin-top: 75px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a3d6e 50%, var(--primary-dark) 100%);
    padding: 100px 0 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-glow-orb {
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: rgba(247,147,30,0.07);
    filter: blur(50px);
}

.hrsg-hero .container {
    position: relative;
    z-index: 2;
}

.page-hero-tag {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.hrsg-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.hrsg-hero p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.78);
    line-height: 1.7;
}

/* ---------- Products Section (Original Dark - kept for index) ---------- */
.products-section {
    background: var(--primary);
    color: var(--white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* Product Category Cards */
.product-category {
    background: rgba(255,255,255,0.06);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--secondary), transparent);
    opacity: 0;
    transition: var(--transition-normal);
}

.product-category:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: var(--shadow-lg);
}

.product-category:hover::before {
    opacity: 1;
}

.product-category.featured {
    background: rgba(247,147,30,0.08);
    border-color: rgba(247,147,30,0.25);
}

/* Product card image */
.product-card-image {
    margin: -24px -24px 20px -24px;
    width: calc(100% + 48px);
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-transition: var(--transition-slow);
            transition: var(--transition-slow);
}

.product-category:hover .product-card-image img {
    -webkit-transform: scale(1.05);
            transform: scale(1.05);
}

.product-category .product-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.product-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.product-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.product-category h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 14px;
    line-height: 1.35;
}

.product-category p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.75;
    margin-bottom: 24px;
}

/* Sub-product list (for categories with sub-items) */
.sub-product-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
    padding: 22px 26px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
}

.sub-product-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-product-list li i {
    color: var(--secondary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.sub-product-list li span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--white);
}

.sub-product-list li p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.65;
    margin-bottom: 0;
}

/* Compact sub-product list for homepage cards */
.sub-product-list.compact {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
    background: transparent;
    border-left: none;
}

.sub-product-list.compact li {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--secondary);
}

.sub-product-list.compact li i {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.sub-product-list.compact li span {
    font-size: 0.9rem;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--secondary);
    letter-spacing: 0.3px;
}

.product-link i {
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.product-link:hover {
    color: var(--secondary-light);
}
.product-link:hover i {
    transform: translateX(4px);
}

/* ---------- Capabilities Section ---------- */
.capabilities-section {
    background: var(--off-white);
}

.capabilities-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.capability-item {
    display: flex;
    gap: 30px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    transition: var(--transition-normal);
    border: 1px solid transparent;
    align-items: flex-start;
}

.capability-item:hover {
    border-color: rgba(247,147,30,0.3);
    box-shadow: var(--shadow-md);
    transform: translateX(6px);
}

.capability-item.gallery-highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
}

.capability-item.gallery-highlight:hover {
    border-color: transparent;
}

.capability-item.gallery-highlight .cap-content p {
    color: rgba(255,255,255,0.8);
}

.capability-item.gallery-highlight .cap-content h3 {
    color: var(--white);
}

.cap-number {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--light-gray);
    line-height: 1;
    min-width: 60px;
}

.capability-item.gallery-highlight .cap-number {
    color: rgba(255,255,255,0.2);
}

.cap-content {
    flex: 1;
}

.cap-content h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cap-content h3 i {
    color: var(--secondary);
    font-size: 1.05rem;
}

.capability-item.gallery-highlight h3 i {
    color: var(--secondary);
}

.cap-content p {
    font-size: 0.93rem;
    color: var(--dark-gray);
    line-height: 1.75;
}

.cap-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary) !important;
}

.cap-link i {
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.cap-link:hover {
    color: var(--secondary-dark) !important;
}
.cap-link:hover i {
    transform: translateX(4px);
}

/* ---------- CTA Banner ---------- */
.cta-banner {
    background-image: url(../images/factory_visual.webp);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    padding: 90px 0;
}

.cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10,36,99,0.92),
        rgba(6,21,57,0.88)
    );
}

.cta-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.cta-content h2 {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 1.08rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 32px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Contacts Section ---------- */
.contacts-section {
    background: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.contact-card {
    background: var(--off-white);
    border-radius: var(--radius-md);
    padding: 26px 28px;
    transition: var(--transition-normal);
    border-left: 4px solid var(--primary);
}

.contact-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-sm);
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.contact-icon i {
    font-size: 1.15rem;
    color: var(--white);
}

.contact-card h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.contact-card p,
.contact-card a {
    font-size: 0.9rem;
    color: var(--dark-gray);
    line-height: 1.7;
}

.contact-card a:hover {
    color: var(--primary);
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--off-white);
    border-radius: var(--radius-lg);
    padding: 38px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 0.93rem;
    font-family: var(--font-primary);
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--dark-gray);
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,36,99,0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--mid-gray);
}

.form-group textarea {
    resize: vertical;
    min-height: 130px;
}

/* ---------- Footer ---------- */
.main-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.75);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

/* Footer Logo Image */
.footer-logo {
    height: 55px;
    width: auto;
    margin-bottom: 14px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.65);
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    transition: var(--transition-fast);
}

.footer-col ul li a:hover {
    color: var(--secondary);
    padding-left: 4px;
}

.footer-col ul li span {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
}

.footer-col ul li i {
    color: var(--secondary);
    margin-right: 8px;
    font-size: 0.82rem;
}

.footer-bottom {
    text-align: center;
    padding: 22px 0;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.45);
}

/* ---------- Back to Top Button ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition-normal);
    z-index: 900;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ---------- Responsive Design ---------- */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 70px 0;
    }

    /* Mobile Navigation */
    .mobile-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--primary-dark);
        flex-direction: column;
        align-items: flex-start;
        padding: 90px 30px 30px;
        gap: 0;
        transition: var(--transition-normal);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .nav-menu > li > a {
        color: rgba(255,255,255,0.9) !important;
        padding: 14px 0;
        font-size: 1rem;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255,255,255,0.05);
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        display: none;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        color: rgba(255,255,255,0.7) !important;
        padding: 10px 16px;
        border: none;
        font-size: 0.88rem;
    }

    .btn-nav-contact {
        margin-top: 16px;
        text-align: center;
        display: block;
    }

    /* Hero Mobile */
    .hero {
        background-attachment: scroll;
        min-height: 85vh;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        text-align: center;
        justify-content: center;
    }

    /* About Grid Mobile */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .image-frame img {
        height: 280px;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    /* Products Mobile */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Alternating layout mobile */
    .products-grid-alt .alt-card {
        margin-bottom: 32px;
    }
    .alt-card,
    .alt-card-reverse {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr !important;
        padding: 26px 22px;
    }
    .alt-card > *:nth-child(1),
    .alt-card-reverse > *:nth-child(1),
    .alt-card > *:nth-child(2),
    .alt-card-reverse > *:nth-child(2) {
        -ms-grid-column: 1;
    }
    .alt-card-visual {
        min-height: 200px;
        -webkit-order: -1;
                order: -1; /* image always on top on mobile */
    }
    .alt-img-wrapper {
        min-height: 200px;
    }
    .alt-card-badge {
        top: 12px;
        left: 12px;
    }
    .alt-card-reverse .alt-card-badge {
        left: 12px;
        right: auto;
    }
    .alt-specs-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .product-category {
        padding: 24px;
    }

    .product-card-image {
        margin: -24px -24px 20px -24px;
        width: calc(100% + 48px);
        height: 160px;
    }

    .sub-product-list {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 18px 16px;
    }

    .sub-product-list.compact {
        gap: 8px;
    }

    .section-header h2 {
        font-size: 1.9rem;
    }

    /* Capabilities Mobile */
    .capability-item {
        flex-direction: column;
        gap: 16px;
        padding: 26px;
    }

    .cap-number {
        font-size: 2rem;
    }

    /* Contact Mobile */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Footer Mobile */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* CTA Banner */
    .cta-content h2 {
        font-size: 1.7rem;
    }

    /* Top bar hidden on very small screens */
    .top-bar {
        display: none;
    }
    .main-header {
        top: 0;
    }
    .hero {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    .about-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .stat-number {
        font-size: 2.2rem;
    }
}
