/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

/* Responsive Grids & Utilities */
.grid-responsive-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.grid-responsive-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.grid-responsive-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.grid-responsive-sidebar {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 6rem;
    align-items: center;
}

.grid-responsive-footer {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8rem;
    margin-bottom: 6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6rem;
}

/* Media Queries */
/* Base Desktop Styles for New Elements */
.hero-title {
    font-size: 4rem;
    margin: 1.5rem 0;
}

.hero-desc {
    font-size: 1.25rem;
    line-height: 1.8;
}

.hero-badge {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: var(--primary-color);
    color: white;
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

/* About Page Quality Section */
.quality-container {
    background: var(--primary-color);
    padding: 6rem;
    border-radius: 60px;
    color: white;
}

.quality-badges-grid {
    gap: 2rem;
}

.quality-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
}

.badge-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.badge-desc {
    font-size: 0.8rem;
    margin: 0;
}

.quality-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.text-white {
    color: white;
    margin-bottom: 2rem;
}

.text-white-opacity {
    opacity: 0.7;
    margin-bottom: 3rem;
}

/* ---------------------------------------------------- */
/* MEDIA QUERIES - MUST BE AT THE BOTTOM FOR OVERRIDES */
/* ---------------------------------------------------- */

@media (max-width: 992px) {

    /* About Quality Section Mobile */
    .quality-container {
        padding: 1.5rem !important;
        border-radius: 30px !important;
    }

    .quality-image {
        height: 300px !important;
        border-radius: 20px !important;
        margin-top: 2rem;
    }

    .quality-badges-grid {
        gap: 1.5rem !important;
    }

    .text-white {
        font-size: 1.75rem !important;
        /* Reduced from 2rem to fit long words */
        margin-bottom: 1.5rem;
        overflow-wrap: break-word;
        /* Ensure it breaks if still too long */
        overflow-wrap: break-word;
        /* Ensure it breaks if still too long */
    }

    /* Reduce Top Spacing on Mobile */
    main[style*="padding-top: 120px"] {
        padding-top: 90px !important;
    }

    /* GLOBAL MOBILE RESET - NUCLEAR OPTION */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }

    * {
        box-sizing: border-box;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .section-title h2 {
        font-size: 2.5rem;
    }

    .grid-responsive-2,
    .grid-responsive-3,
    .grid-responsive-hero,
    .grid-responsive-sidebar,
    .grid-responsive-footer {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }

    /* Stack feature lists (Family Values, etc) on mobile */
    .feature-list,
    .stats-banner>div {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .footer-nav {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        /* Stack footer vertically */
        gap: 3rem;
        text-align: center;
        /* Center align for better mobile look */
    }

    .footer-brand .social-links {
        justify-content: center;
    }

    .footer-nav {
        text-align: left;
        /* Keep lists readable */
        display: grid;
        grid-template-columns: 1fr;
        /* Single column for nav links */
        gap: 2rem;
    }

    .contact-info li {
        justify-content: center;
        /* Center contact info */
    }

    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: block;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 6rem 2rem;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        gap: 1.5rem;
        z-index: 999;
        overflow-y: auto;
        /* Enable scrolling for tall menus */
    }

    .nav-links.active {
        right: 0;
    }

    .nav-item {
        width: 100%;
        padding: 0;
    }

    /* Fix for overlapping dropdown on mobile */
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        left: 0 !important;
        width: 100% !important;
        min-width: auto;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 1.5rem;
        display: none;
        opacity: 1 !important;
        visibility: visible !important;
        border-radius: 0;
        margin-top: 0.5rem;
    }

    .nav-item:hover .dropdown-menu {
        position: static !important;
        transform: none !important;
    }


    .nav-links a {
        display: block;
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Adjust specific elements */
    .hero {
        padding-top: 140px;
        min-height: auto;
        padding-bottom: 6rem;
    }

    .hero-content {
        order: 2;
        text-align: center;
    }

    .hero-btns {
        flex-direction: column !important;
        width: 100% !important;
        gap: 1.5rem !important;
        align-items: center;
    }

    .hero-btns .btn-primary,
    .hero-btns a {
        width: 100% !important;
        justify-content: center !important;
        display: flex !important;
        margin: 0 !important;
    }

    .hero img {
        order: 1;
        margin-bottom: 2rem;
    }

    /* Hide complex decorations on mobile */
    .main-footer {
        padding: 4rem 0 2rem;
        border-radius: 40px 40px 0 0;
    }

    /* Generic Section Padding Reduction */
    .section {
        padding: 3rem 0 !important;
    }

    /* Target specific inline style overrides if needed */
    .section[style*="padding: 8rem"] {
        padding: 3rem !important;
    }

    .section>div>div[style*="padding: 8rem"] {
        padding: 3rem 1.5rem !important;
    }

    h2[style*="font-size: 4rem"] {
        font-size: 2.5rem !important;
    }

    p[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
    }

    /* Header Fixes */
    nav {
        padding: 0 1rem;
        /* Reduce padding */
        height: 70px;
    }

    .logo img {
        height: auto !important;
        max-height: 50px !important;
        max-width: 120px !important;
        object-fit: contain;
    }

    .mobile-nav-toggle {
        font-size: 1.25rem;
        padding: 0.5rem;
    }

    /* Hide the 'Get a Quote' button in header on mobile if it causes overlap */
    nav .btn-primary {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .section-title h1 {
        font-size: 2.5rem !important;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
}

/* Subpage Specific Fixes - Outside Media Query for override power mostly, but targeting mobile via media query is better practice */
@media (max-width: 992px) {

    /* Fix table scrolling in Industrial page */
    .section table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Fix massive padding in Agriculture/Industrial/Pouches/Films inner cards */
    .section div[style*="padding: 4rem"],
    .section div[style*="padding: 5rem"],
    .section div[style*="padding: 6rem"],
    .section div[style*="padding: 8rem"] {
        padding: 2.5rem !important;
        border-radius: 30px !important;
    }

    /* Hero Image sizing adjustments */
    .grid-responsive-hero img {
        height: 300px !important;
        /* Reduce huge height on mobile */
        border-radius: 30px !important;
    }

    /* Reduce font size of hero descriptions on subpages */
    .grid-responsive-hero p {
        font-size: 1rem !important;
    }

    /* Fix absolute positioned badges causing horizontal scroll or overlap (like 'Leak Proof', 'UV Stabilized') */
    .grid-responsive-hero div[style*="position: absolute"] {
        position: static !important;
        margin-top: 1rem;
        width: 100%;
        text-align: center;
        background: var(--bg-light) !important;
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
        backdrop-filter: none !important;
        transform: none !important;
        writing-mode: horizontal-tb !important;
        /* Fix vertical text */
    }

    .grid-responsive-hero div[style*="position: absolute"] * {
        justify-content: center;
        text-align: center;
    }

    /* Fix 'The Bio-Science' cards in agriculture page */
    .grid-responsive-2>div {
        padding: 2rem !important;
    }

    /* Industries Page Fixes */
    /* Remove huge margin bottom from industries grid on mobile */
    .grid-responsive-3[style*="margin-bottom: 8rem"] {
        margin-bottom: 4rem !important;
    }

    /* Fix Global Impact Section padding & radius on Industries Page */
    .section[style*="padding: 6rem"],
    /* Catch general sections if any */
    .section>div>div[style*="padding: 6rem"],
    /* Catch specific inner div in industries.php */
    div[style*="background: var(--primary-color)"] {
        /* Fallback using background color */
        padding: 3rem 1.5rem !important;
        border-radius: 30px !important;
    }

    /* Fix Huge Title in Impact Section and Subpage Heros */
    .section h2[style*="font-size: 3rem"],
    .section h2[style*="font-size: 3.5rem"],
    .section h1[style*="font-size: 5rem"],
    /* Target h1 explicitly for Sustainability */
    .section h1[style*="font-size: 4rem"]

    /* Target h1 explicitly for other pages */
        {
        font-size: 2.5rem !important;
        line-height: 1.2;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Ensure content doesn't touch edges or overflow */
    .grid-responsive-hero>div {
        max-width: 100%;
        overflow-x: hidden;
        /* Prevent horizontal scroll triggers */
    }

    /* Fix Stat Boxes in Sustainability Page */
    .section div[style*="display: flex; justify-content: center; gap: 6rem"] {
        gap: 2rem !important;
        flex-direction: row;
        /* Keep stats side-by-side if small enough, or column */
        width: 100%;
        justify-content: space-around !important;
    }

    /* About Page Timeline Fixes */
    /* Stack timeline items */
    .section div[style*="display: flex; justify-content: space-between"] {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 3rem !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    /* Reset width for timeline content */
    .section div[style*="width: 45%"] {
        width: 100% !important;
        text-align: left !important;
        padding-left: 2rem;
        border-left: 4px solid var(--secondary-color);
    }

    /* Hide the center dots/line on mobile */
    .section div[style*="width: 20px"],
    .section div[style*="position: absolute; left: 50%"] {
        display: none !important;
    }

    /* Fix empty spacers */
    .section div[style*="width: 45%"]:empty {
        display: none;
    }

    /* Contact Page Fixes */
    /* Map Container & General Large Radius Fix */
    div[style*="border-radius: 60px"],
    img[style*="border-radius: 60px"] {
        border-radius: 30px !important;
    }

    /* Reduce padding for glass info boxes (Address/Phone) */
    .glass[style*="padding: 2.5rem"] {
        padding: 1.5rem !important;
    }

    /* About Us - Vision Section Fix */
    /* Target deep nesting for Vision card */
    .section div[style*="padding: 5rem"][style*="background: var(--primary-color)"] {
        padding: 2.5rem !important;
    }

    /* Fix stats row overflow in Vision section */
    .section div[style*="margin-top: 3rem; display: flex; gap: 3rem"] {
        gap: 1.5rem !important;
    }
}

/* ------------------------------------------------------------------ */
/* NEW TIMELINE STYLES (Added during refactor for responsiveness) */
/* ------------------------------------------------------------------ */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5rem;
}

.timeline-row:last-child {
    margin-bottom: 0;
}

.timeline-content {
    width: 45%;
}

.timeline-spacer {
    width: 45%;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 50%;
    border: 5px solid white;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-content .year {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.timeline-content .title {
    font-weight: 700;
    color: var(--primary-color);
}

.timeline-content .desc {
    font-size: 0.9rem;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Mobile Timeline Overrides */
@media (max-width: 992px) {
    .timeline-line {
        display: none;
        /* Hide center line on mobile */
    }

    .timeline-row {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 3rem;
        gap: 1rem;
        width: 100%;
        /* Force full width containment */
        box-sizing: border-box;
        /* Include padding in width calculation */
    }

    .timeline-content {
        width: 100%;
        text-align: left !important;
        padding-left: 1.5rem;
        border-left: 4px solid var(--secondary-color);
        margin: 0;
        /* Remove potential margins causing overflow */
        box-sizing: border-box;
    }

    /* Prevent timeline container from being wider than screen */
    .timeline-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    .timeline-dot,
    .timeline-spacer {
        display: none;
    }

    /* About Page Hero Fixes */
    .hero-title {
        font-size: 2rem !important;
        /* Reduced from 2.5rem to fit 'Excellence' */
        margin: 1rem 0;
        line-height: 1.2;
    }

    .hero-desc {
        font-size: 1rem !important;
        line-height: 1.6;
    }

    .hero-badge {
        position: static !important;
        margin-top: 1.5rem;
        width: 100%;
        background: var(--primary-color);
        color: white;
        padding: 1.5rem !important;
        border-radius: 20px !important;
        text-align: center;
        box-shadow: none !important;
    }
}