<?php
/**
 * File: fine-chemical.php
 * OPPULENT CHEMICALLS EXCELLENCE INNOVATION.
 * Premium Fine Chemicals Page
 * Responsive UI + Product Search + WhatsApp Enquiry
 */

if (session_status() !== PHP_SESSION_ACTIVE) {
    session_start();
}

$pageTitle = "Fine Chemicals | OPPULENT CHEMICALLS EXCELLENCE INNOVATION.";
$bannerImage = "assets/images/dataimgs/banner3.jpg";

include_once __DIR__ . '/header.php';
?>

<!-- Bootstrap & External CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;700;800&family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<style>
/* =========================================================
   OPPULENT — FINE CHEMICALS PREMIUM DESIGN
========================================================= */
.fc-page {
    --fc-green: #086747;
    --fc-green-dark: #06452f;
    --fc-green-light: #e8f5ee;
    --fc-red: #d92332;
    --fc-ink: #152b24;
    --fc-muted: #687a72;
    --fc-bg: #f5f8f6;
    --fc-border: #e2eae5;
    font-family: inherit;
    color: var(--fc-ink);
    overflow: hidden;
    background: #fff;
}

.fc-page,
.fc-page * {
    box-sizing: border-box;
}

.fc-page img {
    max-width: 100%;
}

.fc-page a {
    text-decoration: none;
}

.fc-container {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
}

.fc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fc-green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.fc-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: var(--fc-red);
}

.fc-heading {
    margin: 0 0 17px;
    color: var(--fc-ink);
    font-size: clamp(29px, 3.4vw, 43px);
    line-height: 1.17;
    letter-spacing: -.8px;
    font-weight: 800;
}

.fc-description {
    margin: 0;
    color: var(--fc-muted);
    font-size: 14px;
    line-height: 1.95;
}

.fc-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 11px;
    min-height: 49px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: .25s ease;
}

.fc-btn:hover {
    transform: translateY(-2px);
}

.fc-btn-primary {
    color: #fff;
    background: var(--fc-green);
    box-shadow: 0 9px 22px rgba(8,103,71,.17);
}

.fc-btn-primary:hover {
    color: #fff;
    background: var(--fc-green-dark);
}

.fc-btn-outline {
    color: #fff;
    background: transparent;
    border-color: rgba(255,255,255,.55);
}

.fc-btn-outline:hover {
    color: var(--fc-green-dark);
    background: #fff;
}

/* HERO */
.fc-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 475px;
    background-color: #092f24;
    background-image:
        linear-gradient(100deg, rgba(4,30,22,.94) 0%, rgba(4,40,28,.78) 48%, rgba(4,30,22,.24) 100%),
        url("<?php echo htmlspecialchars($bannerImage, ENT_QUOTES, 'UTF-8'); ?>");
    background-size: cover;
    background-position: center;
}

.fc-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto 0 0;
    height: 5px;
    background: linear-gradient(90deg, var(--fc-red) 0 25%, #fff 25% 27%, var(--fc-green) 27% 100%);
}

.fc-hero-inner {
    padding-top: 75px;
    padding-bottom: 95px;
}

.fc-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50px;
    color: #fff;
    background: rgba(255,255,255,.09);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    margin-bottom: 23px;
}

.fc-hero-label::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #65e2a6;
    box-shadow: 0 0 0 4px rgba(101,226,166,.13);
}

.fc-hero h1 {
    max-width: 790px;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(37px, 5.2vw, 65px);
    line-height: 1.08;
    font-weight: 850;
    letter-spacing: -1.6px;
}

.fc-hero h1 span {
    color: #8fe1b8;
}

.fc-hero p {
    max-width: 650px;
    margin: 0 0 27px;
    color: rgba(255,255,255,.83);
    font-size: 15px;
    line-height: 1.9;
}

.fc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 27px;
}

.fc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
}

.fc-breadcrumb a {
    color: #fff;
}

.fc-breadcrumb a:hover {
    color: #9be9bf;
}

/* TRUST STRIP */
.fc-trust-strip {
    position: relative;
    z-index: 2;
    margin-top: -32px;
}

.fc-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    border: 1px solid var(--fc-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(21,48,35,.09);
}

.fc-trust-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 25px;
}

.fc-trust-item + .fc-trust-item {
    border-left: 1px solid var(--fc-border);
}

.fc-trust-icon {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    color: var(--fc-green);
    background: var(--fc-green-light);
    font-size: 20px;
    font-weight: 800;
}

.fc-trust-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 800;
}

.fc-trust-item small {
    display: block;
    color: var(--fc-muted);
    font-size: 11px;
    line-height: 1.6;
}

/* INTRO */
.fc-intro {
    padding: 95px 0 80px;
}

.fc-intro-grid {
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: 65px;
}

.fc-intro-copy p {
    margin: 0 0 15px;
}

.fc-intro-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin: 25px 0 29px;
}

.fc-intro-point {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #354a40;
    font-size: 12px;
    font-weight: 750;
}

.fc-check {
    display: inline-flex;
    flex: 0 0 23px;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    color: var(--fc-green);
    background: var(--fc-green-light);
    font-size: 12px;
    font-weight: 900;
}

.fc-intro-visual {
    position: relative;
    padding: 12px;
    border-radius: 19px;
    background: linear-gradient(140deg, #d8eee1, #f4f7f4);
}

.fc-intro-visual img {
    display: block;
    width: 100%;
    height: 390px;
    border-radius: 12px;
    object-fit: cover;
}

.fc-image-note {
    position: absolute;
    right: -15px;
    bottom: 28px;
    max-width: 235px;
    padding: 17px 20px;
    border-radius: 10px;
    color: #fff;
    background: var(--fc-green);
    box-shadow: 0 13px 30px rgba(6,69,47,.2);
}

.fc-image-note strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.fc-image-note span {
    color: rgba(255,255,255,.8);
    font-size: 11px;
    line-height: 1.6;
}

/* PRODUCT SECTION */
.fc-products {
    padding: 82px 0;
    background: var(--fc-bg);
}

.fc-section-head {
    max-width: 740px;
    margin: 0 auto 36px;
    text-align: center;
}

.fc-section-head .fc-eyebrow {
    justify-content: center;
}

.fc-section-head .fc-description {
    max-width: 670px;
    margin-inline: auto;
}

.fc-product-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-bottom: 25px;
}

.fc-product-tab,
.fc-search-tab {
    padding: 12px 18px;
    border: 1px solid #dce7e0;
    border-radius: 7px;
    color: #50645a;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

.fc-product-tab.active,
.fc-search-tab.active {
    color: #fff;
    border-color: var(--fc-green);
    background: var(--fc-green);
}

.fc-table-panel {
    display: none;
}

.fc-table-panel.active {
    display: block;
}

.fc-table-card {
    overflow: hidden;
    border: 1px solid var(--fc-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18,50,32,.045);
}

.fc-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 13px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--fc-border);
}

.fc-table-toolbar strong {
    font-size: 15px;
    font-weight: 800;
}

.fc-table-search {
    width: min(100%, 300px);
    height: 42px;
    padding: 0 13px;
    border: 1px solid #dce7e0;
    border-radius: 7px;
    outline: none;
    font: inherit;
    font-size: 12px;
}

.fc-table-search:focus,
.fc-form-control:focus,
.fc-search-input:focus {
    border-color: var(--fc-green);
    box-shadow: 0 0 0 3px rgba(8,103,71,.09);
}

.fc-table-scroll {
    overflow-x: auto;
}

.fc-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    margin: 0;
}

.fc-table th {
    padding: 15px 17px;
    color: #4c6256;
    background: #f4f8f5;
    text-align: left;
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.fc-table td {
    padding: 16px 17px;
    border-top: 1px solid #edf2ee;
    color: #53645b;
    font-size: 12px;
    vertical-align: middle;
}

.fc-table tbody tr:hover {
    background: #fbfdfb;
}

.fc-formula {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 5px;
    color: var(--fc-green);
    background: #eaf6ef;
    font-weight: 800;
    white-space: nowrap;
}

.fc-structure-img {
    display: block;
    width: 95px;
    height: 54px;
    object-fit: contain;
}

.fc-quote-btn {
    padding: 9px 13px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--fc-green);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: .2s ease;
}

.fc-quote-btn:hover {
    background: var(--fc-green-dark);
}

.fc-empty-row {
    display: none;
}

.fc-fine-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 22px;
}

.fc-fine-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
    border: 1px solid var(--fc-border);
    border-radius: 8px;
    background: #fff;
    color: #354a40;
    font-size: 12px;
    line-height: 1.6;
}

.fc-fine-item::before {
    content: "✓";
    display: flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--fc-green);
    background: var(--fc-green-light);
    font-weight: 900;
}

.fc-list-empty {
    display: none;
    padding: 20px;
    color: var(--fc-muted);
    font-size: 13px;
    text-align: center;
}

/* INDUSTRY SLIDER */
.fc-speciality {
    padding: 83px 0;
    background: #fff;
}

.fc-slider-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}

.fc-slider-heading p {
    margin: 0;
}

.fc-slider-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.fc-slider-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border: 1px solid #dce7e0;
    border-radius: 50%;
    color: var(--fc-green);
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: .2s ease;
}

.fc-slider-arrow:hover {
    color: #fff;
    background: var(--fc-green);
    border-color: var(--fc-green);
}

.fc-slider-track {
    display: flex;
    gap: 19px;
    overflow-x: auto;
    padding: 5px 2px 19px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.fc-slider-track::-webkit-scrollbar {
    display: none;
}

.fc-slide {
    flex: 0 0 calc((100% - 57px) / 4);
    min-width: 0;
    scroll-snap-align: start;
}

.fc-industry-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 330px;
    border-radius: 13px;
    background: #17382a;
    box-shadow: 0 9px 28px rgba(14,45,28,.1);
}

.fc-industry-card img {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.fc-industry-card::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(5,25,18,.03) 10%, rgba(5,25,18,.88) 100%);
}

.fc-industry-card:hover img {
    transform: scale(1.07);
}

.fc-industry-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 330px;
    padding: 22px;
}

.fc-industry-tag {
    align-self: flex-start;
    margin-bottom: auto;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 40px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.fc-industry-content h3 {
    margin: 0 0 13px;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.fc-industry-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: flex-start;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.fc-industry-link:hover {
    color: #a6efc4;
}

.fc-slider-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
}

.fc-slider-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 30px;
    background: #ccd9d0;
    cursor: pointer;
    transition: .2s ease;
}

.fc-slider-dot.active {
    width: 24px;
    background: var(--fc-green);
}

/* ENQUIRY */
.fc-enquiry {
    position: relative;
    padding: 84px 0;
    background:
        radial-gradient(circle at 5% 10%, rgba(8,103,71,.08), transparent 28%),
        #f2f7f3;
}

.fc-enquiry-grid {
    display: grid;
    grid-template-columns: .88fr 1.12fr;
    align-items: center;
    gap: 50px;
}

.fc-enquiry-copy h2 {
    margin: 0 0 17px;
    color: var(--fc-ink);
    font-size: clamp(30px, 3.2vw, 43px);
    line-height: 1.18;
    letter-spacing: -.7px;
    font-weight: 850;
}

.fc-enquiry-copy > p {
    color: var(--fc-muted);
    font-size: 14px;
    line-height: 1.9;
}

.fc-contact-points {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.fc-contact-point {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #344a3e;
    font-size: 12px;
    font-weight: 750;
}

.fc-contact-icon {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    color: var(--fc-green);
    background: #e0f1e6;
    font-size: 18px;
}

.fc-form-card {
    padding: 31px;
    border: 1px solid #e0eae3;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(19,57,36,.08);
}

.fc-form-card h3 {
    margin: 0 0 7px;
    color: var(--fc-ink);
    font-size: 24px;
    font-weight: 850;
}

.fc-form-subtitle {
    margin: 0 0 24px;
    color: #77867e;
    font-size: 12px;
    line-height: 1.7;
}

.fc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.fc-form-group {
    min-width: 0;
}

.fc-form-group.full {
    grid-column: 1 / -1;
}

.fc-form-group label {
    display: block;
    margin-bottom: 7px;
    color: #43574b;
    font-size: 11px;
    font-weight: 800;
}

.fc-form-control {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #dce6df;
    border-radius: 7px;
    outline: none;
    color: #24372d;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    transition: .2s ease;
}

.fc-form-control::placeholder {
    color: #9aa89f;
}

.fc-phone-row {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 8px;
}

textarea.fc-form-control {
    min-height: 105px;
    resize: vertical;
}

.fc-form-submit {
    width: 100%;
    margin-top: 20px;
    border: 0;
    font-family: inherit;
}

.fc-form-note {
    margin: 12px 0 0;
    color: #87948c;
    font-size: 10px;
    line-height: 1.75;
    text-align: center;
}

.fc-form-status {
    display: none;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 7px;
    color: #8d1c28;
    background: #fff0f1;
    font-size: 12px;
    line-height: 1.6;
}

/* INFORMATION */
.fc-seo {
    padding: 55px 0;
    background: #fff;
}

.fc-seo-inner {
    max-width: 1000px;
    margin-inline: auto;
}

.fc-seo h2 {
    margin: 0 0 17px;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 850;
}

.fc-seo p {
    margin: 0 0 13px;
    color: var(--fc-muted);
    font-size: 12px;
    line-height: 1.95;
}

/* FLOATING WHATSAPP */
.fc-whatsapp-float {
    position: fixed;
    z-index: 999;
    right: 20px;
    bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #fff;
    background: #20bd63;
    box-shadow: 0 8px 25px rgba(0,0,0,.2);
    font-size: 25px;
    transition: transform .2s ease;
}

.fc-whatsapp-float:hover {
    color: #fff;
    transform: translateY(-4px);
}

/* RESPONSIVE */
@media (max-width: 991px) {
    .fc-hero {
        min-height: 410px;
    }

    .fc-intro-grid,
    .fc-enquiry-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .fc-intro-visual {
        max-width: 680px;
        width: 100%;
        margin-inline: auto;
    }

    .fc-slide {
        flex-basis: calc((100% - 19px) / 2);
    }

    .fc-trust-item {
        padding: 18px 15px;
    }

    .fc-trust-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .fc-fine-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .fc-container {
        width: calc(100% - 28px);
    }

    .fc-hero {
        min-height: 385px;
        background-position: 62% center;
    }

    .fc-hero-inner {
        padding-top: 57px;
        padding-bottom: 70px;
    }

    .fc-hero h1 {
        font-size: clamp(35px, 10vw, 47px);
        letter-spacing: -.9px;
    }

    .fc-hero p {
        font-size: 13px;
    }

    .fc-hero-actions .fc-btn {
        width: 100%;
    }

    .fc-trust-strip {
        margin-top: -22px;
    }

    .fc-trust-grid {
        grid-template-columns: 1fr;
    }

    .fc-trust-item {
        padding: 14px 17px;
    }

    .fc-trust-item + .fc-trust-item {
        border-top: 1px solid var(--fc-border);
        border-left: 0;
    }

    .fc-intro,
    .fc-products,
    .fc-speciality,
    .fc-enquiry {
        padding: 58px 0;
    }

    .fc-intro-grid {
        gap: 27px;
    }

    .fc-intro-points {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fc-intro-visual {
        padding: 8px;
    }

    .fc-intro-visual img {
        height: 275px;
    }

    .fc-image-note {
        right: 12px;
        bottom: 18px;
        max-width: 205px;
        padding: 13px 15px;
    }

    .fc-section-head {
        margin-bottom: 27px;
    }

    .fc-product-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .fc-product-tab {
        width: 100%;
    }

    .fc-table-toolbar {
        padding: 16px;
    }

    .fc-table-search {
        width: 100%;
    }

    .fc-fine-list {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .fc-slider-heading {
        align-items: flex-start;
        gap: 13px;
    }

    .fc-slider-heading .fc-heading {
        font-size: 27px;
    }

    .fc-slider-heading .fc-description {
        font-size: 12px;
    }

    .fc-slider-controls {
        gap: 5px;
    }

    .fc-slider-arrow {
        width: 35px;
        height: 35px;
        font-size: 17px;
    }

    .fc-slide {
        flex-basis: 82%;
    }

    .fc-industry-card,
    .fc-industry-content {
        min-height: 300px;
    }

    .fc-form-card {
        padding: 23px 16px;
    }

    .fc-form-card h3 {
        font-size: 22px;
    }

    .fc-form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .fc-form-group.full {
        grid-column: auto;
    }

    .fc-phone-row {
        grid-template-columns: 108px minmax(0, 1fr);
    }

    .fc-seo {
        padding: 42px 0;
    }

    .fc-seo h2 {
        font-size: 21px;
    }

    .fc-whatsapp-float {
        right: 13px;
        bottom: 15px;
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fc-page *,
    .fc-page *::before,
    .fc-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
</style>

<main class="fc-page">

    <!-- PREMIUM HERO -->
    <section class="fc-hero">
        <div class="fc-container fc-hero-inner">
            <span class="fc-hero-label">Quality • Precision • Chemical Expertise</span>

            <h1>
                Fine Chemicals for
                <span>Specialised Applications</span>
            </h1>

            <p>
                Explore application-focused chemical solutions for research,
                pharmaceutical, agricultural, cosmetic and industrial requirements.
                Tell us what you need and let our team help you take the next step.
            </p>

            <div class="fc-hero-actions">
                <a href="#fc-products" class="fc-btn fc-btn-primary">
                    Explore Products <span aria-hidden="true">→</span>
                </a>
                <a href="#fc-enquiry" class="fc-btn fc-btn-outline">
                    Request a Quotation <span aria-hidden="true">↗</span>
                </a>
            </div>

            <nav class="fc-breadcrumb" aria-label="Breadcrumb">
                <a href="index.php">Home</a>
                <span>/</span>
                <a href="performance-chemicals.php">Performance Chemicals</a>
                <span>/</span>
                <span>Fine Chemicals</span>
            </nav>
        </div>
    </section>

    <!-- TRUST STRIP -->
    <section class="fc-trust-strip">
        <div class="fc-container">
            <div class="fc-trust-grid">
                <div class="fc-trust-item">
                    <span class="fc-trust-icon" aria-hidden="true">✓</span>
                    <div>
                        <strong>Application-Focused</strong>
                        <small>Solutions guided by your requirements</small>
                    </div>
                </div>

                <div class="fc-trust-item">
                    <span class="fc-trust-icon" aria-hidden="true">◎</span>
                    <div>
                        <strong>Specification-Oriented</strong>
                        <small>Product details reviewed against your needs</small>
                    </div>
                </div>

                <div class="fc-trust-item">
                    <span class="fc-trust-icon" aria-hidden="true">↗</span>
                    <div>
                        <strong>Direct Enquiries</strong>
                        <small>Convenient communication through WhatsApp</small>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- INTRODUCTION -->
    <section class="fc-intro">
        <div class="fc-container">
            <div class="fc-intro-grid">
                <div class="fc-intro-copy">
                    <span class="fc-eyebrow">Our Fine Chemicals Division</span>

                    <h2 class="fc-heading">
                        Chemical Solutions Designed Around Your Requirements
                    </h2>

                    <p class="fc-description">
                        At OPPULENT CHEMICALLS EXCELLENCE INNOVATION., we aim to make
                        specialised chemical sourcing clearer, more responsive and
                        more convenient for businesses. Our Fine Chemicals portfolio
                        includes selected products for research, pharmaceutical,
                        agricultural, cosmetic and other industrial applications.
                    </p>

                    <p class="fc-description">
                        Every application has its own technical and commercial
                        requirements. Share the chemical name, CAS number, grade,
                        intended use and required quantity so that your enquiry can
                        be reviewed with the relevant product specifications in mind.
                    </p>

                    <div class="fc-intro-points">
                        <div class="fc-intro-point">
                            <span class="fc-check">✓</span>
                            Product-specific enquiries
                        </div>
                        <div class="fc-intro-point">
                            <span class="fc-check">✓</span>
                            Application-led communication
                        </div>
                        <div class="fc-intro-point">
                            <span class="fc-check">✓</span>
                            Research and industrial needs
                        </div>
                        <div class="fc-intro-point">
                            <span class="fc-check">✓</span>
                            Clear quotation requests
                        </div>
                    </div>

                    <a href="#fc-enquiry" class="fc-btn fc-btn-primary">
                        Discuss Your Requirement <span aria-hidden="true">→</span>
                    </a>
                </div>

                <div class="fc-intro-visual">
                    <img
                        src="assets/images/Triethyl-citrate.jpg"
                        alt="Fine chemical product and laboratory applications"
                        loading="lazy"
                    >

                    <div class="fc-image-note">
                        <strong>Details Matter</strong>
                        <span>Share your specifications to help us understand your requirement.</span>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- PRODUCT CATALOGUE -->
    <section class="fc-products" id="fc-products">
        <div class="fc-container">
            <div class="fc-section-head">
                <span class="fc-eyebrow">Product Catalogue</span>
                <h2 class="fc-heading">Explore Our Fine Chemical Range</h2>
                <p class="fc-description">
                    Browse the listed products, search by name or CAS number,
                    and request a quotation for the product that matches your needs.
                    Availability and specifications are confirmed during enquiry.
                </p>
            </div>

            <div class="fc-product-tabs" role="tablist" aria-label="Product categories">
                <button class="fc-product-tab active" type="button"
                        data-product-tab="pharma" role="tab" aria-selected="true">
                    Pharma Chemicals
                </button>

                <button class="fc-product-tab" type="button"
                        data-product-tab="research" role="tab" aria-selected="false">
                    Life &amp; Research Chemicals
                </button>

                <button class="fc-product-tab" type="button"
                        data-product-tab="fine" role="tab" aria-selected="false">
                    Fine Chemicals
                </button>
            </div>

            <!-- PHARMA -->
            <div class="fc-table-panel active" id="fc-panel-pharma" role="tabpanel">
                <div class="fc-table-card">
                    <div class="fc-table-toolbar">
                        <strong>Pharma Chemicals</strong>

                        <input
                            type="search"
                            class="fc-table-search"
                            data-table-search="fc-table-pharma"
                            placeholder="Search name or CAS number..."
                            aria-label="Search pharma chemicals"
                        >
                    </div>

                    <div class="fc-table-scroll">
                        <table class="fc-table" id="fc-table-pharma">
                            <thead>
                                <tr>
                                    <th>CAS Number</th>
                                    <th>Chemical Name</th>
                                    <th>Molecular Formula</th>
                                    <th>Structure</th>
                                    <th>Enquiry</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>102-76-1</td>
                                    <td><strong>Triacetin</strong></td>
                                    <td><span class="fc-formula">C9H14O6</span></td>
                                    <td>
                                        <img
                                            class="fc-structure-img"
                                            src="assets/images/finechemical/Triacetin.png"
                                            alt="Triacetin molecular structure"
                                            loading="lazy"
                                        >
                                    </td>
                                    <td>
                                        <button type="button" class="fc-quote-btn"
                                                data-quote-product="Triacetin">
                                            Get Quote →
                                        </button>
                                    </td>
                                </tr>

                                <tr>
                                    <td>77-93-0</td>
                                    <td><strong>Triethyl Citrate</strong></td>
                                    <td><span class="fc-formula">C12H20O7</span></td>
                                    <td>
                                        <img
                                            class="fc-structure-img"
                                            src="assets/images/finechemical/Triethyl-citrate.png"
                                            alt="Triethyl citrate molecular structure"
                                            loading="lazy"
                                        >
                                    </td>
                                    <td>
                                        <button type="button" class="fc-quote-btn"
                                                data-quote-product="Triethyl Citrate">
                                            Get Quote →
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- RESEARCH -->
            <div class="fc-table-panel" id="fc-panel-research" role="tabpanel">
                <div class="fc-table-card">
                    <div class="fc-table-toolbar">
                        <strong>Life &amp; Research Chemicals</strong>

                        <input
                            type="search"
                            class="fc-table-search"
                            data-table-search="fc-table-research"
                            placeholder="Search name or CAS number..."
                            aria-label="Search research chemicals"
                        >
                    </div>

                    <div class="fc-table-scroll">
                        <table class="fc-table" id="fc-table-research">
                            <thead>
                                <tr>
                                    <th>CAS Number</th>
                                    <th>Chemical Name</th>
                                    <th>Molecular Formula</th>
                                    <th>Structure</th>
                                    <th>Enquiry</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>88-67-5</td>
                                    <td><strong>2-Iodobenzoic Acid</strong></td>
                                    <td><span class="fc-formula">C7H5IO2</span></td>
                                    <td>
                                        <img
                                            class="fc-structure-img"
                                            src="assets/images/finechemical/2-Iodo-benzoic-acid.png"
                                            alt="2-Iodobenzoic acid molecular structure"
                                            loading="lazy"
                                        >
                                    </td>
                                    <td>
                                        <button type="button" class="fc-quote-btn"
                                                data-quote-product="2-Iodobenzoic Acid">
                                            Get Quote →
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <!-- FINE CHEMICALS -->
            <div class="fc-table-panel" id="fc-panel-fine" role="tabpanel">
                <div class="fc-table-card">
                    <div class="fc-table-toolbar">
                        <strong>Fine Chemicals Product List</strong>

                        <input
                            type="search"
                            class="fc-table-search"
                            data-table-search="fc-fine-list"
                            placeholder="Search chemical names..."
                            aria-label="Search fine chemicals list"
                        >
                    </div>

                    <div class="fc-fine-list" id="fc-fine-list">
                        <?php
                        $fineChemicalNames = [
                            '1,3,5-Triacetyl Benzene',
                            '1,4-Diiodo Benzene',
                            '2-Iodobenzoic Acid',
                            'Aldehyde C 14',
                            'Amyl Salicylate',
                            'Glycerol Formal',
                            'Lauroyl Chloride',
                            'Triacetin',
                            'Triethyl Citrate'
                        ];

                        foreach ($fineChemicalNames as $chemicalName):
                        ?>
                            <div class="fc-fine-item">
                                <span><?php echo htmlspecialchars($chemicalName, ENT_QUOTES, 'UTF-8'); ?></span>
                                <button
                                    type="button"
                                    class="fc-quote-btn"
                                    data-quote-product="<?php echo htmlspecialchars($chemicalName, ENT_QUOTES, 'UTF-8'); ?>"
                                >
                                    Enquire
                                </button>
                            </div>
                        <?php endforeach; ?>
                    </div>

                    <div class="fc-list-empty" id="fcFineEmpty">
                        No matching chemicals found. Try another search.
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- SPECIALITY CHEMICALS -->
    <section class="fc-speciality" id="fc-speciality">
        <div class="fc-container">
            <div class="fc-slider-heading">
                <div>
                    <span class="fc-eyebrow">Explore Our Portfolio</span>
                    <h2 class="fc-heading">Speciality Chemicals</h2>
                    <p class="fc-description">
                        Discover chemical solutions across a range of industrial sectors.
                    </p>
                </div>

                <div class="fc-slider-controls">
                    <button type="button" class="fc-slider-arrow" id="fcSlidePrev"
                            aria-label="Previous categories">&#8592;</button>
                    <button type="button" class="fc-slider-arrow" id="fcSlideNext"
                            aria-label="Next categories">&#8594;</button>
                </div>
            </div>

            <div class="fc-slider-track" id="fcSliderTrack">

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Paints.jpg" alt="Paint and coating chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 01</span>
                            <h3>Paints &amp; Coatings</h3>
                            <a class="fc-industry-link" href="coatings-inks.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Paper.jpg" alt="Paper chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 02</span>
                            <h3>Paper Chemicals</h3>
                            <a class="fc-industry-link" href="paper-chemicals.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/fine-chemicals.jpg" alt="Fine chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 03</span>
                            <h3>Fine Chemicals</h3>
                            <a class="fc-industry-link" href="fine-chemical.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Finished.jpg" alt="Finished lubricants" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 04</span>
                            <h3>Finished Lubricants</h3>
                            <a class="fc-industry-link" href="finished-lubricants.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Food Colours.jpg" alt="Food colours" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 05</span>
                            <h3>Food Colours</h3>
                            <a class="fc-industry-link" href="food-colours.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Textile.jpg" alt="Textile chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 06</span>
                            <h3>Textile Chemicals</h3>
                            <a class="fc-industry-link" href="textile-chemicals.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Water.jpg" alt="Water treatment chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 07</span>
                            <h3>Water Treatment</h3>
                            <a class="fc-industry-link" href="water-technologies-division.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Vooki.jpg" alt="Hygiene products" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 08</span>
                            <h3>Hygiene Products</h3>
                            <a class="fc-industry-link" href="hygiene-products.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Leather.jpg" alt="Leather chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 09</span>
                            <h3>Leather Chemicals</h3>
                            <a class="fc-industry-link" href="leather-chemicals.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/oil.jpg" alt="Oil field chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 10</span>
                            <h3>Oil Field Chemicals</h3>
                            <a class="fc-industry-link" href="oil-field-chemicals.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Pigment.jpg" alt="Pigment products" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 11</span>
                            <h3>Pigment Exports</h3>
                            <a class="fc-industry-link" href="pigment-exports.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/Polyurethanes.jpg" alt="Polymer additives" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 12</span>
                            <h3>Polymer Additives</h3>
                            <a class="fc-industry-link" href="polymers-additives.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/listings/purit.jpg" alt="Rust preventive products" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 13</span>
                            <h3>Rust Preventives</h3>
                            <a class="fc-industry-link" href="rust-preventive-oil.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

                <article class="fc-slide">
                    <div class="fc-industry-card">
                        <img src="assets/images/sugar.jpg" alt="Sugar industry chemicals" loading="lazy">
                        <div class="fc-industry-content">
                            <span class="fc-industry-tag">Industry 14</span>
                            <h3>Sugar Chemicals</h3>
                            <a class="fc-industry-link" href="sugar-chemicals.php">Explore Division →</a>
                        </div>
                    </div>
                </article>

            </div>

            <div class="fc-slider-dots" id="fcSliderDots" aria-label="Slider navigation"></div>
        </div>
    </section>

    <!-- WHATSAPP ENQUIRY -->
    <section class="fc-enquiry" id="fc-enquiry">
        <div class="fc-container">
            <div class="fc-enquiry-grid">

                <div class="fc-enquiry-copy">
                    <span class="fc-eyebrow">Let's Discuss Your Needs</span>

                    <h2>
                        Looking for the Right Chemical for Your Application?
                    </h2>

                    <p>
                        Send us your product requirement, grade, application and
                        expected quantity. Our team can review the information and
                        discuss product availability and quotation details with you.
                    </p>

                    <div class="fc-contact-points">
                        <div class="fc-contact-point">
                            <span class="fc-contact-icon" aria-hidden="true">✓</span>
                            <span>Product and specification enquiries</span>
                        </div>

                        <div class="fc-contact-point">
                            <span class="fc-contact-icon" aria-hidden="true">↗</span>
                            <span>Convenient WhatsApp communication</span>
                        </div>

                        <div class="fc-contact-point">
                            <span class="fc-contact-icon" aria-hidden="true">＋</span>
                            <span>Bulk, sample and customised requirements</span>
                        </div>
                    </div>
                </div>

                <div class="fc-form-card">
                    <h3>Request a Product Quotation</h3>
                    <p class="fc-form-subtitle">
                        Complete the details below. Your enquiry will open in WhatsApp
                        with the information pre-filled.
                    </p>

                    <form id="fcWhatsappEnquiry">
                        <div class="fc-form-grid">

                            <div class="fc-form-group">
                                <label for="fcName">Full Name *</label>
                                <input class="fc-form-control" type="text"
                                       id="fcName" name="name"
                                       placeholder="Enter your full name"
                                       autocomplete="name" required>
                            </div>

                            <div class="fc-form-group">
                                <label for="fcEmail">Business Email *</label>
                                <input class="fc-form-control" type="email"
                                       id="fcEmail" name="email"
                                       placeholder="name@company.com"
                                       autocomplete="email" required>
                            </div>

                            <div class="fc-form-group full">
                                <label for="fcMobile">Mobile Number *</label>
                                <div class="fc-phone-row">
                                    <select class="fc-form-control"
                                            id="fcCountryCode" name="country_code" required>
                                        <option value="+91" selected>India (+91)</option>
                                        <option value="+1">USA/Canada (+1)</option>
                                        <option value="+44">UK (+44)</option>
                                        <option value="+971">UAE (+971)</option>
                                        <option value="+65">Singapore (+65)</option>
                                    </select>

                                    <input class="fc-form-control" type="tel"
                                           id="fcMobile" name="mobile"
                                           placeholder="Mobile number"
                                           autocomplete="tel-national"
                                           inputmode="tel" required>
                                </div>
                            </div>

                            <div class="fc-form-group">
                                <label for="fcLocation">City / Country *</label>
                                <input class="fc-form-control" type="text"
                                       id="fcLocation" name="location"
                                       placeholder="Your location" required>
                            </div>

                            <div class="fc-form-group">
                                <label for="fcCompany">Company Name</label>
                                <input class="fc-form-control" type="text"
                                       id="fcCompany" name="company"
                                       placeholder="Your company">
                            </div>

                            <div class="fc-form-group full">
                                <label for="fcProduct">Chemical / Product Required *</label>
                                <input class="fc-form-control" type="text"
                                       id="fcProduct" name="product"
                                       placeholder="Enter chemical name or CAS number"
                                       required>
                            </div>

                            <div class="fc-form-group">
                                <label for="fcQuantity">Required Quantity *</label>
                                <input class="fc-form-control" type="text"
                                       id="fcQuantity" name="quantity"
                                       placeholder="e.g. 25 kg / 200 kg" required>
                            </div>

                            <div class="fc-form-group">
                                <label for="fcApplication">Application</label>
                                <input class="fc-form-control" type="text"
                                       id="fcApplication" name="application"
                                       placeholder="Intended use">
                            </div>

                            <div class="fc-form-group full">
                                <label for="fcMessage">Specifications / Message</label>
                                <textarea class="fc-form-control"
                                          id="fcMessage" name="message"
                                          placeholder="Mention grade, purity, packaging or other requirements..."></textarea>
                            </div>

                        </div>

                        <button type="submit" class="fc-btn fc-btn-primary fc-form-submit">
                            Send Enquiry on WhatsApp <span aria-hidden="true">↗</span>
                        </button>

                        <div class="fc-form-status" id="fcFormStatus" role="alert"></div>

                        <p class="fc-form-note">
                            WhatsApp opens with your details pre-filled. Please review
                            the message and press Send in WhatsApp to submit your enquiry.
                        </p>
                    </form>
                </div>

            </div>
        </div>
    </section>

    <!-- SEO CONTENT -->
    <section class="fc-seo">
        <div class="fc-container fc-seo-inner">
            <h2>Fine Chemicals for Research and Industrial Applications</h2>

            <p>
                Fine chemicals serve a wide range of specialised applications in
                research, pharmaceutical development, agriculture, cosmetics and
                industrial manufacturing. Choosing a suitable chemical requires
                attention to product identity, grade, specifications, intended
                application and handling requirements.
            </p>

            <p>
                OPPULENT CHEMICALLS EXCELLENCE INNOVATION. welcomes enquiries for
                the fine chemical products listed on this page. To help us understand
                your request, include the chemical name or CAS number, desired quantity,
                application and any available specification requirements.
            </p>

            <p>
                Product information, availability, packaging and commercial terms
                should be confirmed for each enquiry. Use the quotation form above
                to send your requirements directly through WhatsApp.
            </p>
        </div>
    </section>

</main>

<!-- FLOATING WHATSAPP BUTTON -->
<a class="fc-whatsapp-float"
   href="https://wa.me/917428465992?text=<?php echo rawurlencode('Hello, I would like to enquire about Fine Chemicals.'); ?>"
   target="_blank"
   rel="noopener noreferrer"
   aria-label="Contact us on WhatsApp"
   title="Chat on WhatsApp">
    <svg viewBox="0 0 32 32" width="27" height="27" aria-hidden="true" fill="currentColor">
        <path d="M16.02 3.2A12.55 12.55 0 0 0 5.24 22.2L3.55 28.4l6.35-1.66A12.55 12.55 0 1 0 16.02 3.2Zm0 22.86a10.3 10.3 0 0 1-5.24-1.43l-.38-.22-3.77.99 1.01-3.67-.25-.39A10.29 10.29 0 1 1 16.02 26.06Zm5.65-7.72c-.31-.16-1.84-.91-2.13-1.01-.28-.1-.49-.16-.7.16-.21.31-.8 1.01-.98 1.22-.18.21-.36.23-.67.08-.31-.16-1.31-.48-2.49-1.53-.92-.82-1.54-1.83-1.72-2.14-.18-.31-.02-.48.14-.64.14-.14.31-.36.47-.54.16-.18.21-.31.31-.52.1-.21.05-.39-.03-.55-.08-.16-.7-1.69-.96-2.31-.25-.6-.51-.52-.7-.53l-.59-.01c-.21 0-.54.08-.82.39-.28.31-1.08 1.06-1.08 2.59 0 1.53 1.11 3 1.27 3.21.16.21 2.18 3.33 5.28 4.67.74.32 1.32.51 1.77.65.74.23 1.41.2 1.94.12.59-.09 1.84-.75 2.1-1.48.26-.73.26-1.35.18-1.48-.08-.13-.28-.21-.59-.36Z"/>
    </svg>
</a>

<script>
(function () {
    "use strict";

    /* SEARCH MODE TABS */
    const searchTabs = document.querySelectorAll(".fc-search-tab");
    const searchTypeInput = document.getElementById("fcSearchType");
    const searchInput = document.getElementById("fcSearchInput");

    const searchPlaceholders = {
        all: "Search products, CAS number or applications...",
        chemist: "Enter a chemical name or CAS number...",
        application: "Enter an application or industry..."
    };

    searchTabs.forEach(function (tab) {
        tab.addEventListener("click", function () {
            searchTabs.forEach(function (item) {
                item.classList.remove("active");
            });

            tab.classList.add("active");

            const mode = tab.getAttribute("data-search-mode");

            if (searchTypeInput) {
                searchTypeInput.value = mode;
            }

            if (searchInput) {
                searchInput.placeholder =
                    searchPlaceholders[mode] || searchPlaceholders.all;
            }
        });
    });

    /* PRODUCT CATEGORY TABS */
    const productTabs = document.querySelectorAll("[data-product-tab]");
    const panels = {
        pharma: document.getElementById("fc-panel-pharma"),
        research: document.getElementById("fc-panel-research"),
        fine: document.getElementById("fc-panel-fine")
    };

    productTabs.forEach(function (tab) {
        tab.addEventListener("click", function () {
            productTabs.forEach(function (item) {
                item.classList.remove("active");
                item.setAttribute("aria-selected", "false");
            });

            Object.values(panels).forEach(function (panel) {
                if (panel) panel.classList.remove("active");
            });

            tab.classList.add("active");
            tab.setAttribute("aria-selected", "true");

            const key = tab.getAttribute("data-product-tab");

            if (panels[key]) {
                panels[key].classList.add("active");
            }
        });
    });

    /* PRODUCT TABLE AND LIST SEARCH */
    document.querySelectorAll("[data-table-search]").forEach(function (input) {
        input.addEventListener("input", function () {
            const targetId = input.getAttribute("data-table-search");
            const target = document.getElementById(targetId);

            if (!target) return;

            const term = input.value.trim().toLowerCase();

            if (target.tagName === "TABLE") {
                target.querySelectorAll("tbody tr").forEach(function (row) {
                    row.style.display = row.textContent.toLowerCase().includes(term)
                        ? ""
                        : "none";
                });
            } else {
                let visibleCount = 0;

                target.querySelectorAll(".fc-fine-item").forEach(function (item) {
                    const matches = item.textContent.toLowerCase().includes(term);
                    item.style.display = matches ? "" : "none";

                    if (matches) visibleCount++;
                });

                const emptyState = document.getElementById("fcFineEmpty");

                if (emptyState) {
                    emptyState.style.display = visibleCount ? "none" : "block";
                }
            }
        });
    });

    /* SPECIALITY CHEMICALS SLIDER */
    const slider = document.getElementById("fcSliderTrack");
    const previous = document.getElementById("fcSlidePrev");
    const next = document.getElementById("fcSlideNext");
    const dotsBox = document.getElementById("fcSliderDots");

    if (slider && previous && next && dotsBox) {
        let currentIndex = 0;
        let resizeTimer;

        function visibleSlides() {
            if (window.matchMedia("(max-width: 600px)").matches) return 1;
            if (window.matchMedia("(max-width: 991px)").matches) return 2;
            return 4;
        }

        function maxIndex() {
            return Math.max(0, slider.querySelectorAll(".fc-slide").length - visibleSlides());
        }

        function slideStep() {
            const first = slider.querySelector(".fc-slide");
            if (!first) return 0;

            const trackStyle = window.getComputedStyle(slider);
            const gap = parseFloat(trackStyle.columnGap || trackStyle.gap) || 0;

            return first.getBoundingClientRect().width + gap;
        }

        function updateDots() {
            const dots = dotsBox.querySelectorAll(".fc-slider-dot");

            dots.forEach(function (dot, index) {
                dot.classList.toggle("active", index === currentIndex);
                dot.setAttribute("aria-current", index === currentIndex ? "true" : "false");
            });
        }

        function goTo(index) {
            currentIndex = Math.max(0, Math.min(index, maxIndex()));

            slider.scrollTo({
                left: currentIndex * slideStep(),
                behavior: "smooth"
            });

            updateDots();
        }

        function createDots() {
            dotsBox.innerHTML = "";

            for (let i = 0; i <= maxIndex(); i++) {
                const dot = document.createElement("button");

                dot.type = "button";
                dot.className = "fc-slider-dot";
                dot.setAttribute("aria-label", "Show category position " + (i + 1));

                dot.addEventListener("click", function () {
                    goTo(i);
                });

                dotsBox.appendChild(dot);
            }

            currentIndex = Math.min(currentIndex, maxIndex());
            updateDots();
        }

        previous.addEventListener("click", function () {
            goTo(currentIndex <= 0 ? maxIndex() : currentIndex - 1);
        });

        next.addEventListener("click", function () {
            goTo(currentIndex >= maxIndex() ? 0 : currentIndex + 1);
        });

        slider.addEventListener("scroll", function () {
            const step = slideStep();

            if (step > 0) {
                currentIndex = Math.max(
                    0,
                    Math.min(Math.round(slider.scrollLeft / step), maxIndex())
                );
                updateDots();
            }
        }, { passive: true });

        window.addEventListener("resize", function () {
            window.clearTimeout(resizeTimer);

            resizeTimer = window.setTimeout(function () {
                createDots();
                goTo(currentIndex);
            }, 150);
        });

        createDots();
    }

    /* QUOTE BUTTONS: PREFILL PRODUCT NAME */
    document.querySelectorAll("[data-quote-product]").forEach(function (button) {
        button.addEventListener("click", function () {
            const productField = document.getElementById("fcProduct");
            const productName = button.getAttribute("data-quote-product");

            if (!productField) return;

            productField.value = productName || "";
            document.getElementById("fc-enquiry").scrollIntoView({
                behavior: "smooth",
                block: "start"
            });

            window.setTimeout(function () {
                productField.focus({ preventScroll: true });
            }, 500);
        });
    });

    /* WHATSAPP ENQUIRY FORM */
    const enquiryForm = document.getElementById("fcWhatsappEnquiry");
    const statusBox = document.getElementById("fcFormStatus");

    if (enquiryForm) {
        enquiryForm.addEventListener("submit", function (event) {
            event.preventDefault();

            if (!enquiryForm.checkValidity()) {
                enquiryForm.reportValidity();
                return;
            }

            const getValue = function (id) {
                const field = document.getElementById(id);
                return field ? field.value.trim() : "";
            };

            const name = getValue("fcName");
            const email = getValue("fcEmail");
            const countryCode = getValue("fcCountryCode");
            const mobile = getValue("fcMobile");
            const location = getValue("fcLocation");
            const company = getValue("fcCompany");
            const product = getValue("fcProduct");
            const quantity = getValue("fcQuantity");
            const application = getValue("fcApplication");
            const message = getValue("fcMessage");

            const phoneDigits = mobile.replace(/\D/g, "");

            if (phoneDigits.length < 6 || phoneDigits.length > 15) {
                if (statusBox) {
                    statusBox.textContent = "Please enter a valid mobile number.";
                    statusBox.style.display = "block";
                }

                document.getElementById("fcMobile").focus();
                return;
            }

            if (statusBox) {
                statusBox.style.display = "none";
                statusBox.textContent = "";
            }

            const enquiryLines = [
                "HELLO OPPULENT CHEMICALLS EXCELLENCE INNOVATION.",
                "I would like to enquire about your Fine Chemicals products.",
                "",
                "CUSTOMER DETAILS",
                "Full Name: " + name,
                "Email: " + email,
                "Mobile: " + countryCode + " " + mobile,
                "Location: " + location,
                "Company: " + (company || "Not provided"),
                "",
                "PRODUCT REQUIREMENT",
                "Product / Chemical: " + product,
                "Required Quantity: " + quantity,
                "Application: " + (application || "Not specified"),
                "Specifications / Message: " + (message || "Not provided"),
                "",
                "Please share the relevant product information, availability and quotation details.",
                "Thank you."
            ];

            const whatsappNumber = "917428465992";
            const whatsappURL =
                "https://wa.me/" + whatsappNumber +
                "?text=" + encodeURIComponent(enquiryLines.join("\n"));

            const whatsappWindow = window.open(
                whatsappURL,
                "_blank",
                "noopener,noreferrer"
            );

            /*
             * Some browsers block new tabs if pop-ups are disabled.
             * In that case, show a helpful message rather than losing the enquiry.
             */
            if (!whatsappWindow) {
                if (statusBox) {
                    statusBox.textContent =
                        "Your enquiry is ready. Please allow pop-ups for this website and submit again, or use the green WhatsApp button.";
                    statusBox.style.display = "block";
                }
            }
        });
    }
})();
</script>

<?php
include_once __DIR__ . '/footer.php';
?>