:root {
    --primary-color: #c1121f;
    --primary-dark: #9d0e19;
    --primary-soft: rgba(193, 18, 31, 0.12);
    --secondary-color: #f1faee;
    --text-dark: #1d3557;
    --text-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-light: #f4f6f9;
    --gray-light: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(29, 53, 87, 0.06);
    --shadow-md: 0 8px 24px rgba(29, 53, 87, 0.1);
    --shadow-lg: 0 16px 40px rgba(29, 53, 87, 0.12);
    --transition: all 0.25s ease;
    --radius: 12px;
    --header-h: 72px;
}

html {
    scroll-behavior: smooth;
}

.site-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.65;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    color: #fff;
    padding: 0.6rem 1.35rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(193, 18, 31, 0.35);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(193, 18, 31, 0.45);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Top bar */
.top-bar {
    background: linear-gradient(90deg, #1d3557 0%, #152a45 100%);
    color: var(--text-light);
    font-size: 0.8125rem;
}

.top-bar a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

/* Header / navbar — no horizontal scroll */
.site-header .navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.site-header .navbar > .container-fluid {
    max-width: 100%;
}

.navbar-brand {
    flex-shrink: 0;
    margin-right: 0.75rem;
}

/* Mark + wordmark (no duplicate full-text logo image) */
.site-logo-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: contain;
}

@media (min-width: 1200px) {
    .site-logo-mark {
        width: 48px;
        height: 48px;
    }
}

.site-logo-wide {
    display: block;
    max-height: 48px;
    width: auto;
    max-width: min(200px, 46vw);
    object-fit: contain;
}

@media (min-width: 1200px) {
    .site-logo-wide {
        max-height: 52px;
        max-width: 220px;
    }
}

.sh-toggler {
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
}

.navbar-inner {
    min-width: 0;
}

.nav-main .nav-link {
    color: var(--text-dark) !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    white-space: nowrap;
}

@media (max-width: 1199.98px) {
    .nav-main .nav-link {
        white-space: normal;
    }
}

.nav-main .nav-link:hover,
.nav-main .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--primary-soft);
}

.nav-search-form {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-width: 0;
    flex-shrink: 0;
}

@media (max-width: 1199.98px) {
    .nav-search-form {
        max-width: 100%;
    }
}

.search-input {
    border-radius: 999px;
    padding-left: 1rem;
    padding-right: 1rem;
    border: 1px solid var(--gray-light);
    font-size: 0.875rem;
    width: 100%;
    min-width: 0;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(193, 18, 31, 0.18);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1080;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--gray-light);
}

.search-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Hero */
.hero-slider .carousel-item {
    min-height: clamp(320px, 55vh, 560px);
    height: auto;
    background-size: cover;
    background-position: center;
    position: relative;
    /* Keep Bootstrap's default display behavior.
       We'll opt-in flex only for active/transition slides. */
    align-items: center;
    justify-content: center;
}

/* Ensure only one banner content is visible at a time */
.hero-slider .carousel-item.active,
.hero-slider .carousel-item-next,
.hero-slider .carousel-item-prev,
.hero-slider .carousel-item.carousel-item-start,
.hero-slider .carousel-item.carousel-item-end {
    display: flex;
}

.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
    z-index: 3;
    width: 3rem;
    height: 3rem;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.hero-slider .carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(29, 53, 87, 0.75) 0%, rgba(0, 0, 0, 0.45) 100%);
}

.hero-caption {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: clamp(2rem, 6vw, 4rem) 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Home: intro/stat chips */
.stat-chip {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(29, 53, 87, 0.08);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--text-dark);
    box-shadow: 0 6px 18px rgba(29, 53, 87, 0.08);
}
.stat-chip i { color: var(--primary-color); }

.hero-caption h1 {
    font-size: clamp(1.75rem, 4.5vw, 3.25rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.15;
    text-wrap: balance;
}

.hero-caption .lead {
    font-size: clamp(1rem, 1.35vw, 1.25rem);
    line-height: 1.55;
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
    word-break: normal;
    overflow-wrap: anywhere;
}

.hero-caption p,
.hero-caption h1 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.hero-fallback {
    min-height: clamp(320px, 50vh, 480px);
    background: linear-gradient(135deg, #1d3557 0%, #c1121f 55%, #1d3557 100%);
}

.hero-fallback .hero-caption {
    animation: none;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-hero {
    position: relative;
}

.page-hero .display-4,
.page-hero .display-5 {
    font-size: clamp(1.65rem, 4vw, 2.75rem);
}

/* Cards premium */
.card {
    border: 1px solid rgba(29, 53, 87, 0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: #fff;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(193, 18, 31, 0.12);
}

.product-img-wrapper {
    height: clamp(200px, 28vw, 260px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8f9fb 0%, #eef1f6 100%);
}

.product-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.45s ease;
}

.card:hover .product-img-wrapper img {
    transform: scale(1.04);
}

/* Footer */
.footer {
    background: linear-gradient(180deg, #1a2d44 0%, #152433 100%);
    color: var(--text-light);
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
}

.footer h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.95;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

/* Sections */
.section-muted {
    background: linear-gradient(180deg, var(--bg-light) 0%, #fff 55%);
}

.cat-tile {
    border: 1px solid rgba(29, 53, 87, 0.08) !important;
    border-radius: var(--radius);
}

.cat-tile:hover {
    box-shadow: var(--shadow-md) !important;
    border-color: rgba(193, 18, 31, 0.2) !important;
}

.logo-strip,
.logo-strip-lg {
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.88;
    transition: var(--transition);
}

.logo-strip {
    max-height: 56px;
}

.logo-strip-lg {
    max-height: 72px;
}

.logo-strip:hover,
.logo-strip-lg:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.scroll-margin-top {
    scroll-margin-top: 96px;
}

/* Legacy / CMS content */
.blog-content img,
.about-content img,
.product-long-desc img {
    max-width: 100%;
    height: auto;
}

.about-content,
.blog-content,
.legacy-career {
    font-size: 1rem;
}

.about-content table,
.legacy-career table {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.about-content ul,
.about-content ol {
    padding-left: 1.25rem;
}

.page-hero .breadcrumb a {
    text-decoration: none;
}

.page-hero .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

.legacy-career .faq-title h4,
.legacy-career h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Gallery legacy strip */
.legacy-gallery-strip .col-6 {
    max-width: 100%;
}

.legacy-gallery-strip img {
    border-radius: var(--radius);
}

/* Gallery thumb → lightbox */
.gallery-thumb {
    display: block;
    border-radius: var(--radius);
    transition: var(--transition);
}
.gallery-thumb:hover {
    opacity: 0.92;
    transform: translateY(-2px);
}
.gallery-thumb-img {
    display: block;
    width: 100%;
    vertical-align: middle;
}
.gallery-lightbox-img {
    max-height: calc(100vh - 8rem);
    object-fit: contain;
}

/* Owl logo carousels */
.logo-owl-wrap {
    position: relative;
}
.logo-owl-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-height: 108px;
    border: 1px solid rgba(29, 53, 87, 0.06);
}
.logo-owl-img {
    max-height: 72px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.logo-owl-wrap .owl-nav {
    margin-top: 0.35rem;
}
.logo-owl-wrap .owl-nav button.owl-prev,
.logo-owl-wrap .owl-nav button.owl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    margin: 0 !important;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--shadow-sm);
    color: var(--text-dark) !important;
}
.logo-owl-wrap .owl-nav button.owl-prev {
    left: -6px;
}
.logo-owl-wrap .owl-nav button.owl-next {
    right: -6px;
}
.logo-owl-wrap .owl-nav button.owl-prev:hover,
.logo-owl-wrap .owl-nav button.owl-next:hover {
    background: #fff !important;
    color: var(--primary-color) !important;
}
.logo-owl-wrap .owl-dots {
    margin-top: 0.75rem;
}
.logo-owl-wrap .owl-dots .owl-dot span {
    background: rgba(29, 53, 87, 0.25);
}
.logo-owl-wrap .owl-dots .owl-dot.active span,
.logo-owl-wrap .owl-dots .owl-dot:hover span {
    background: var(--primary-color);
}
.logo-owl-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
