/* File Path: css/style.css */

:root {
    --bs-primary: #005724;
    --bs-primary-dark: #003e19;
    --bs-warning: #FFA500;
    --bs-warning-hover: #e68a00;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-secondary: #6c757d;
    --border-radius-base: 0.75rem;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 8px 28px rgba(0, 87, 36, 0.14);
}

/* ==========================================================================
   1. Base & Mobile-First Reset
   NOTE: `overflow-x: clip` is used instead of `hidden` on html/body because
   `clip` does NOT create a scroll container, so `position: sticky` on the
   header keeps working. This is a last-resort guard against sub-pixel /
   decorative overflow; the real causes are fixed below.
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--bs-dark);
    background-color: #ffffff;
    line-height: 1.6;
    margin: 0;
    overflow-wrap: break-word;
}

/* Global media guard: nothing may exceed its container */
img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

img {
    height: auto; /* fixed-height components below override this safely */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    color: var(--bs-dark);
    line-height: 1.3;
    overflow-wrap: break-word;
}

a {
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
    overflow-wrap: break-word;
}

/* Sticky header offset for in-page anchor links */
[id] {
    scroll-margin-top: 90px;
}

/* Utility Colors */
.text-primary {
    color: var(--bs-primary) !important;
}

.text-warning {
    color: var(--bs-warning) !important;
}

.text-orange {
    color: var(--bs-warning) !important;
}

.bg-primary {
    background-color: var(--bs-primary) !important;
}

.bg-light {
    background-color: var(--bs-light) !important;
}

/* ==========================================================================
   2. Spinner & Back-to-Top
   ========================================================================== */
#spinner {
    background: var(--bs-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0s linear 0.4s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity 0.4s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   3. Buttons (Mobile-First)
   ========================================================================== */
.btn {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: normal; /* allow long CTA labels to wrap instead of overflow */
    max-width: 100%;
}

.btn-square,
.btn-sm-square,
.btn-md-square,
.btn-lg-square,
.btn-xl-square {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.btn-square { width: 28px; height: 28px; }
.btn-sm-square { width: 32px; height: 32px; }
.btn-md-square { width: 40px; height: 40px; }
.btn-lg-square { width: 48px; height: 48px; }
.btn-xl-square { width: 56px; height: 56px; }

@media (min-width: 768px) {
    .btn-square { width: 32px; height: 32px; }
    .btn-sm-square { width: 34px; height: 34px; }
    .btn-md-square { width: 44px; height: 44px; }
    .btn-lg-square { width: 54px; height: 54px; }
    .btn-xl-square { width: 64px; height: 64px; }
}

.btn.btn-primary {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border: 1px solid var(--bs-primary) !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background-color: var(--bs-warning) !important;
    color: #000000 !important;
    border-color: var(--bs-warning) !important;
}

.btn.btn-dark {
    background-color: var(--bs-warning) !important;
    color: #000000 !important;
    border: 1px solid var(--bs-warning) !important;
}

.btn.btn-dark:hover,
.btn.btn-dark:focus {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
}

.btn.btn-warning {
    background-color: var(--bs-warning) !important;
    color: #000000 !important;
    border: 1px solid var(--bs-warning) !important;
}

.btn.btn-warning:hover,
.btn.btn-warning:focus {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
}

/* Action Button Group (fire.html & CTA buttons) */
.cta-button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    max-width: 100%;
}

.cta-button-group .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

@media (min-width: 576px) {
    .cta-button-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem 1.25rem;
    }
}

/* ==========================================================================
   4. Topbar & Sticky Navbar (Mobile-First)
   ========================================================================== */
.topbar {
    padding: 6px 16px;
    background-color: var(--bs-primary) !important;
    color: #ffffff;
}

.topbar i {
    color: var(--bs-warning) !important;
}

.topbar a {
    color: #ffffff !important;
    font-size: 0.85rem;
}

.topbar a:hover {
    color: var(--bs-warning) !important;
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #ffffff;
    transition: box-shadow 0.3s ease;
}

.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0.65rem 1rem !important;
}

.navbar .navbar-brand {
    min-width: 0;
    max-width: 70%;
}

.navbar .navbar-brand .logo {
    max-height: 36px;
    max-width: 100%;
    width: auto;
}

.navbar .navbar-toggler {
    padding: 6px 12px;
    color: #ffffff;
    background-color: var(--bs-primary);
    border: none;
    flex-shrink: 0;
}

/* Mobile dropdown menu must scroll if it is taller than the viewport */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.navbar .navbar-nav {
    padding-top: 0.5rem;
}

.navbar .navbar-nav .nav-link {
    color: #000000 !important;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.6rem 0.75rem !important;
    position: relative;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary) !important;
}

@media (min-width: 992px) {
    .navbar {
        padding: 0.75rem 1.5rem !important;
    }

    .navbar .navbar-brand {
        max-width: none;
    }

    .navbar .navbar-brand .logo {
        max-height: 44px;
    }

    .navbar .navbar-nav {
        padding-top: 0;
        align-items: center;
    }

    .navbar .navbar-nav .nav-link {
        font-size: 0.94rem;
        padding: 0.5rem 0.65rem !important;
        margin: 0 2px;
        white-space: nowrap;
    }

    .navbar .navbar-nav .nav-link::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0.65rem;
        right: 0.65rem;
        height: 2px;
        background-color: var(--bs-warning);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .navbar .navbar-nav .nav-link:hover::after,
    .navbar .navbar-nav .nav-link.active::after {
        transform: scaleX(1);
    }
}

/* ==========================================================================
   5. Hero Carousel & Page Breadcrumb Header (Mobile-First)
   ========================================================================== */
.header-carousel {
    width: 100%;
    max-width: 100%;
}

.header-carousel .header-carousel-item {
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.header-carousel .header-carousel-item img {
    width: 100%;
    height: 480px;
    object-fit: cover;
}

.header-carousel .header-carousel-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 50, 20, 0.68);
    z-index: 2;
}

.header-carousel .header-carousel-item .carousel-caption {
    position: absolute;
    inset: 0;
    width: 92%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 5;
    padding: 1rem;
}

.header-carousel .carousel-caption h1,
.header-carousel .carousel-caption h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-carousel .carousel-caption p {
    font-size: 0.95rem;
}

.owl-prev,
.owl-next {
    display: none;
}

@media (max-width: 399.98px) {
    .header-carousel .carousel-caption h1,
    .header-carousel .carousel-caption h2 {
        font-size: 1.45rem;
    }

    .header-carousel .carousel-caption p {
        font-size: 0.88rem;
    }
}

@media (min-width: 768px) {
    .header-carousel .header-carousel-item,
    .header-carousel .header-carousel-item img {
        height: 600px;
    }

    .header-carousel .carousel-caption h1,
    .header-carousel .carousel-caption h2 {
        font-size: 2.5rem;
    }

    .header-carousel .carousel-caption p {
        font-size: 1.15rem;
    }
}

@media (min-width: 992px) {
    .header-carousel .header-carousel-item,
    .header-carousel .header-carousel-item img {
        height: 680px;
    }

    .header-carousel .carousel-caption h1,
    .header-carousel .carousel-caption h2 {
        font-size: 3rem;
    }

    .owl-prev,
    .owl-next {
        position: absolute;
        width: 52px;
        height: 52px;
        top: 50%;
        transform: translateY(-50%);
        border-radius: 50%;
        background: var(--bs-primary);
        color: var(--bs-warning);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.3s;
        z-index: 6;
    }

    .owl-prev { left: 25px; }
    .owl-next { right: 25px; }

    .owl-prev:hover,
    .owl-next:hover {
        background: var(--bs-warning) !important;
        color: var(--bs-primary) !important;
    }
}

/* Single Page Breadcrumb Header */
.bg-breadcrumb {
    position: relative;
    overflow: hidden;
    background: linear-gradient(rgba(0, 40, 16, 0.78), rgba(0, 40, 16, 0.78)), url("../img/carousel-1.jpg") center center / cover no-repeat;
    padding: 4rem 0;
    z-index: 1;
}

@media (min-width: 992px) {
    .bg-breadcrumb {
        padding: 5.5rem 0;
    }
}

.bg-breadcrumb .breadcrumb-item a {
    color: var(--bs-warning) !important;
    font-weight: 600;
}

/* ==========================================================================
   6. Service Cards & Modals (Mobile-First)
   ========================================================================== */
.service-item {
    background: #ffffff;
    border-radius: var(--border-radius-base);
    padding: 1.25rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.service-item .service-img {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    height: 180px;
    margin-bottom: 1rem;
}

.service-item .service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-item:hover .service-img img {
    transform: scale(1.06);
}

.service-item .service-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.service-item .service-content-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.service-item .service-content-inner a.h6 {
    font-size: 1.05rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    display: block;
    overflow-wrap: break-word;
}

.service-item .service-content-inner p {
    font-size: 0.92rem;
    color: #444444;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.read-more-btn {
    font-size: 0.85rem;
    background-color: #f0f7f2;
    color: var(--bs-primary);
    border: 1px solid var(--bs-primary);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background-color: var(--bs-primary);
    color: #ffffff;
}

/* Popup Modal */
.popup-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.popup-content {
    background-color: #ffffff;
    border-radius: var(--border-radius-base);
    padding: 1.25rem;
    position: relative;
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.popup-header {
    background-color: var(--bs-primary);
    color: #ffffff;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.popup-logo {
    width: 100px;
    height: auto;
    flex: 0 0 auto;
}

.popup-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--bs-warning);
    margin: 0;
    flex-grow: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.close-btn {
    font-size: 1.75rem;
    line-height: 1;
    background: transparent;
    border: none;
    color: var(--bs-warning);
    cursor: pointer;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.popup-subheading {
    font-size: 1.25rem;
    color: var(--bs-dark);
    font-weight: 700;
    margin: 0.5rem 0 1rem;
    text-align: center;
}

.popup-image {
    text-align: center;
    margin-bottom: 1rem;
}

.popup-image img {
    max-width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.popup-bulletpoints {
    list-style: none;
    padding-left: 0;
    font-size: 0.95rem;
    line-height: 1.65;
}

.popup-bulletpoints li {
    color: var(--bs-dark);
    margin-bottom: 0.65rem;
}

.popup-bulletpoints li span.bold-text {
    font-weight: 700;
    color: var(--bs-primary);
}

.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #555555;
}

.popup-footer .modal-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-wrap: wrap;
}

.popup-footer .modal-branding img {
    height: 24px;
    width: auto;
}

/* ==========================================================================
   7. Knowledge Hub Section (Fixed Visibility During Scroll)
   ========================================================================== */
.knowledge-hub {
    background: linear-gradient(135deg, #f4f8f5 0%, #ffffff 100%);
    padding: 3.5rem 0;
    position: relative;
    z-index: 2;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.knowledge-hub .text-center,
.knowledge-hub .blog-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none;
}

.blog-item {
    background: #ffffff;
    border-radius: var(--border-radius-base);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 87, 36, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}

.blog-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.blog-item i {
    color: var(--bs-primary);
    font-size: 2.75rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.blog-item:hover i {
    transform: scale(1.1);
}

.blog-item h3,
.blog-item h5 {
    color: var(--bs-dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    overflow-wrap: break-word;
}

.blog-item p {
    color: #444444;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   8. About Page Uniform Pillar Grid
   ========================================================================== */
.pillar-uniform-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}

@media (min-width: 576px) {
    .pillar-uniform-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.pillar-card {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid rgba(0, 87, 36, 0.15);
    border-left: 4px solid var(--bs-primary);
    border-radius: 0.5rem;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-align: left;
    height: 100%;
    min-width: 0;
}

.pillar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 87, 36, 0.1);
    border-left-color: var(--bs-warning);
}

.pillar-card i {
    color: var(--bs-primary);
    font-size: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.pillar-card span {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bs-dark);
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: break-word;
}

/* ==========================================================================
   9. FAQ Section
   ========================================================================== */
.faq {
    position: relative;
}

.faq-heading {
    color: var(--bs-primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.faq-main-title {
    color: var(--bs-warning);
    font-size: 1.85rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .faq-main-title {
        font-size: 2.25rem;
    }
}

.faq-text {
    color: var(--bs-dark);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq .faq-img {
    position: relative;
}

.faq .faq-img .faq-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   10. Contact Section & Redesigned Accessible Forms
   ========================================================================== */
.contact h4 {
    color: var(--bs-primary);
    font-weight: 700;
}

.contact-item h4 {
    color: var(--bs-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.contact-item p {
    color: var(--bs-dark);
    font-size: 0.95rem;
    overflow-wrap: break-word;
}

/* Clean Fieldset & Label-Above-Input Architecture */
.b2b-enquiry-form fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background-color: #fcfdfc;
    min-width: 0;
}

.b2b-enquiry-form legend {
    float: none;
    width: auto;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.b2b-enquiry-form .form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--bs-dark);
    margin-bottom: 0.4rem;
}

.b2b-enquiry-form .form-control,
.b2b-enquiry-form .form-select {
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    color: var(--bs-dark);
    background-color: #ffffff;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.b2b-enquiry-form .form-control:focus,
.b2b-enquiry-form .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 87, 36, 0.15);
    outline: none;
}

.form-feedback-msg {
    display: none;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 1rem;
    text-align: center;
}

.form-feedback-msg.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.form-feedback-msg.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.form-feedback-msg.info {
    display: block;
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
}

/* Loading Animation for Submit Button */
button.loading {
    position: relative;
    opacity: 0.75;
    pointer-events: none;
}

button.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   11. Footer & Copyright (Mobile-First)
   ========================================================================== */
.footer {
    background: #ffffff;
    border-top: 1px solid #eaeaea;
}

.footer .footer-item h4 {
    color: var(--bs-warning);
    font-weight: 700;
}

.footer .footer-item a,
.footer .footer-item p {
    line-height: 2;
    color: var(--bs-primary);
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.footer .footer-item a:hover {
    color: var(--bs-warning);
    padding-left: 4px;
}

.footer .footer-logo-img {
    max-width: 160px;
    width: 100%;
    height: auto;
}

.copyright {
    border-top: 1px solid #eaeaea;
    background: #f8f9fa !important;
    color: var(--bs-primary);
    font-size: 0.875rem;
}

/* ==========================================================================
   12. Small-Screen Polish (≤575.98px)
   ========================================================================== */
@media (max-width: 575.98px) {
    .service-item {
        padding: 1rem;
    }

    .blog-item {
        padding: 1.25rem 1rem;
    }

    .cta-button-group .btn {
        width: 100%;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .b2b-enquiry-form fieldset {
        padding: 1rem;
    }

    .popup-content {
        padding: 1rem;
    }

    .popup-title {
        font-size: 1rem;
    }

    .footer .footer-item a,
    .footer .footer-item p {
        font-size: 0.9rem;
    }
}