<?php
/*
|--------------------------------------------------------------------------
| OPPULENT CHEMICALLS — PREMIUM LAB CHEMICALS PAGE
| File: lab-chemicals.php
|--------------------------------------------------------------------------
| Search: Product name, CAS No, Code, Grade
| COA request: WhatsApp
| Product quotation: WhatsApp
| Contact form: WhatsApp
|--------------------------------------------------------------------------
*/

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

$pageTitle = 'Lab Chemicals | Oppulent Chemicalls';
$pageDescription = 'Explore laboratory chemicals, AR, LR and HPLC grades. Search products by name or CAS number and request a quotation or COA.';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?= htmlspecialchars($pageDescription, ENT_QUOTES, 'UTF-8'); ?>">
<title><?= htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?></title>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700;800&display=swap" rel="stylesheet">

<style>
:root {
    --lab-navy: #071b31;
    --lab-blue: #087fc0;
    --lab-cyan: #10bde9;
    --lab-text: #26394d;
    --lab-muted: #718096;
    --lab-border: #e2eaf2;
    --lab-bg: #f4f8fc;
    --lab-green: #16865b;
    --lab-radius: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--lab-text);
    background: #fff;
    font-family: "DM Sans", sans-serif;
    line-height: 1.7;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.lab-page {
    width: 100%;
    overflow: hidden;
}

.lab-container {
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
}

/* HERO */

.lab-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 86px 0 105px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 18%, rgba(16,189,233,.22), transparent 28%),
        linear-gradient(120deg, rgba(4,18,34,.97), rgba(5,64,103,.89)),
        url("assets/images/lab-chemical.jpg") center/cover no-repeat;
}

.lab-hero::before,
.lab-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    pointer-events: none;
}

.lab-hero::before {
    width: 480px;
    height: 480px;
    right: -150px;
    top: -220px;
}

.lab-hero::after {
    width: 330px;
    height: 330px;
    right: -75px;
    top: -145px;
}

.lab-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50px;
    background: rgba(255,255,255,.07);
    color: #c5f3ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.lab-eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lab-cyan);
    box-shadow: 0 0 0 5px rgba(16,189,233,.14);
}

.lab-hero h1 {
    max-width: 800px;
    margin: 22px 0 16px;
    color: #fff;
    font: 800 clamp(36px, 5vw, 62px)/1.12 "Manrope", sans-serif;
    letter-spacing: -2px;
}

.lab-hero h1 span { color: #69ddfa; }

.lab-hero p {
    max-width: 690px;
    margin: 0;
    color: #d0dfec;
    font-size: 16px;
    line-height: 1.9;
}

.lab-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
    color: #c6d6e5;
    font-size: 13px;
}

.lab-breadcrumb a {
    color: #fff;
    text-decoration: none;
}

.lab-breadcrumb a:hover { color: #69ddfa; }

/* SEARCH PANEL */

.lab-search-section {
    position: relative;
    z-index: 2;

    margin-top: -40px;
}

.lab-search-card {
    padding: 28px;
    border: 1px solid #e7edf4;
    border-radius: var(--lab-radius);
    background: #fff;
    box-shadow: 0 20px 55px rgba(7,27,49,.12);
}

.lab-search-heading {
    margin: 0 0 6px;
    color: var(--lab-navy);
    font: 800 23px "Manrope", sans-serif;
}

.lab-search-subtitle {
    margin: 0 0 20px;
    color: var(--lab-muted);
    font-size: 14px;
}

.lab-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
}

.lab-tab {
    padding: 10px 17px;
    border: 1px solid var(--lab-border);
    border-radius: 10px;
    background: #f5f8fc;
    color: #50647a;
    font-size: 13px;
    font-weight: 800;
    transition: .2s ease;
}

.lab-tab:hover,
.lab-tab.active {
    border-color: var(--lab-blue);
    background: #eaf6ff;
    color: #0767a4;
}

.lab-search-form {
    display: flex;
    gap: 12px;
}

.lab-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.lab-search-icon {
    position: absolute;
    top: 50%;
    left: 17px;
    transform: translateY(-50%);
    color: #8495a7;
    pointer-events: none;
}

.lab-search-input {
    width: 100%;
    min-height: 58px;
    padding: 15px 16px 15px 48px;
    border: 1px solid #dce6ef;
    border-radius: 12px;
    outline: none;
    background: #f9fbfd;
    color: var(--lab-navy);
    font-size: 14px;
    transition: .2s ease;
}

.lab-search-input:focus {
    border-color: var(--lab-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8,127,192,.09);
}

.lab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 12px 19px;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.lab-btn:hover { transform: translateY(-2px); }

.lab-btn-primary {
    background: linear-gradient(135deg, #087fc0, #075caa);
    color: #fff;
    box-shadow: 0 7px 18px rgba(8,127,192,.2);
}

.lab-btn-primary:hover {
    box-shadow: 0 10px 24px rgba(8,127,192,.3);
}

.lab-search-submit {
    min-width: 145px;
    min-height: 58px;
}

.lab-search-hint {
    margin-top: 12px;
    color: #8492a2;
    font-size: 12px;
}

/* COMMON SECTIONS */

.lab-section { padding: 70px 0; }

.lab-section-soft { background: var(--lab-bg); }

.lab-section-heading {
    max-width: 760px;
    margin: 0 auto 35px;
    text-align: center;
}

.lab-section-label {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--lab-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.lab-section-heading h2 {
    margin: 0 0 12px;
    color: var(--lab-navy);
    font: 800 clamp(27px, 3.5vw, 38px)/1.25 "Manrope", sans-serif;
    letter-spacing: -1px;
}

.lab-section-heading p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 14px;
    line-height: 1.9;
}

/* BENEFITS */

.lab-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.lab-feature {
    padding: 25px;
    border: 1px solid var(--lab-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(7,27,49,.035);
}

.lab-feature-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 17px;
    place-items: center;
    border-radius: 14px;
    background: #e9f6ff;
    color: #087fc0;
    font-size: 23px;
}

.lab-feature h3 {
    margin: 0 0 8px;
    color: var(--lab-navy);
    font: 800 17px "Manrope", sans-serif;
}

.lab-feature p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* COA LOOKUP */

.lab-coa-card {
    display: grid;
    grid-template-columns: 1fr minmax(280px, .85fr);
    gap: 35px;
    align-items: center;
    padding: 36px;
    border: 1px solid #dce8f3;
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0, rgba(16,189,233,.13), transparent 35%),
        linear-gradient(130deg, #f0f7ff, #fff);
    box-shadow: 0 12px 35px rgba(7,27,49,.06);
}

.lab-coa-card h2 {
    margin: 0 0 10px;
    color: var(--lab-navy);
    font: 800 28px "Manrope", sans-serif;
}

.lab-coa-card p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 14px;
    line-height: 1.9;
}

.lab-coa-form {
    display: flex;
    gap: 10px;
}

.lab-input {
    width: 100%;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #dce6ef;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--lab-navy);
    font-size: 14px;
}

.lab-input:focus {
    border-color: var(--lab-blue);
    box-shadow: 0 0 0 3px rgba(8,127,192,.08);
}

/* PRODUCT TABLE */

.lab-products-section { padding: 70px 0; }

.lab-table-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.lab-table-top h2 {
    margin: 0 0 8px;
    color: var(--lab-navy);
    font: 800 clamp(25px, 3vw, 34px) "Manrope", sans-serif;
}

.lab-table-top p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 14px;
}

.lab-result-count {
    flex-shrink: 0;
    padding: 9px 13px;
    border: 1px solid #d9eaff;
    border-radius: 999px;
    background: #eff7ff;
    color: #075fa4;
    font-size: 12px;
    font-weight: 800;
}

.lab-table-card {
    overflow: hidden;
    border: 1px solid var(--lab-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 9px 30px rgba(7,27,49,.055);
}

.lab-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.lab-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.lab-table th {
    padding: 17px 18px;
    background: #f1f6fb;
    color: #243b53;
    border-bottom: 1px solid #dce6ef;
    font: 800 12px "Manrope", sans-serif;
    letter-spacing: .25px;
    white-space: nowrap;
}

.lab-table td {
    padding: 17px 18px;
    border-bottom: 1px solid #edf2f7;
    color: #516175;
    font-size: 13px;
    vertical-align: middle;
}

.lab-table tbody tr:nth-child(even) { background: #fbfdff; }
.lab-table tbody tr:hover { background: #f0f8ff; }
.lab-table tbody tr:last-child td { border-bottom: 0; }

.lab-product-name {
    color: var(--lab-navy) !important;
    font-weight: 800;
    min-width: 210px;
}

.lab-cas {
    color: #536d83 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lab-grade {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 7px;
    background: #edf7ff;
    color: #086cae;
    font-size: 11px;
    font-weight: 800;
}

.lab-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #c8e4f9;
    border-radius: 9px;
    background: #eff8ff;
    color: #0769a7;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transition: .2s ease;
}

.lab-action-btn:hover {
    background: #087fc0;
    border-color: #087fc0;
    color: #fff;
}

.lab-quote-btn {
    border-color: #bfe8d5;
    background: #effbf5;
    color: #13764e;
}

.lab-quote-btn:hover {
    border-color: #16865b;
    background: #16865b;
    color: #fff;
}

.lab-no-results {
    display: none;
    padding: 38px 20px;
    text-align: center;
    color: var(--lab-muted);
}

.lab-no-results strong {
    display: block;
    margin-bottom: 6px;
    color: var(--lab-navy);
    font-size: 18px;
}

.lab-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 18px;
    border-top: 1px solid var(--lab-border);
    background: #fbfdff;
    color: var(--lab-muted);
    font-size: 12px;
}

/* DESCRIPTION */

.lab-copy {
    max-width: 980px;
    margin: 0 auto;
}

.lab-copy h2 {
    margin: 0 0 20px;
    color: var(--lab-navy);
    font: 800 30px/1.35 "Manrope", sans-serif;
    letter-spacing: -.6px;
}

.lab-copy h3 {
    margin: 28px 0 10px;
    color: var(--lab-navy);
    font: 800 20px "Manrope", sans-serif;
}

.lab-copy p {
    margin: 0 0 17px;
    color: #536477;
    font-size: 14px;
    line-height: 2;
}

.lab-copy a {
    color: var(--lab-blue);
    font-weight: 700;
    text-decoration: none;
}

.lab-copy a:hover { text-decoration: underline; }

/* CONTACT */

.lab-contact-section {
    padding: 75px 0;
    background: #f1f5f8;
}

.lab-contact-layout {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    border: 1px solid #e3eaf0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(7,27,49,.08);
}

.lab-contact-form-side { padding: 38px; }

.lab-contact-heading {
    margin-bottom: 24px;
}

.lab-contact-heading .lab-section-label { margin-bottom: 7px; }

.lab-contact-heading h2 {
    margin: 0 0 9px;
    color: var(--lab-navy);
    font: 800 29px "Manrope", sans-serif;
}

.lab-contact-heading p {
    margin: 0;
    color: var(--lab-muted);
    font-size: 13px;
    line-height: 1.8;
}

.lab-contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lab-form-group { min-width: 0; }
.lab-form-group.full { grid-column: 1 / -1; }

.lab-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #354b60;
    font-size: 12px;
    font-weight: 800;
}

.lab-form-group .lab-input { min-height: 48px; }

.lab-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.lab-contact-submit {
    width: 100%;
    min-height: 52px;
    grid-column: 1 / -1;
    background: #16865b;
    color: #fff;
    box-shadow: 0 8px 20px rgba(22,134,91,.16);
}

.lab-contact-submit:hover {
    background: #106c49;
    box-shadow: 0 10px 25px rgba(22,134,91,.25);
}

.lab-contact-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 540px;
    padding: 36px;
    color: #fff;
    background:
        linear-gradient(0deg, rgba(3,20,37,.96), rgba(3,20,37,.06) 80%),
        linear-gradient(135deg, #0b4a71, #071b31);
}

.lab-contact-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.lab-contact-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(0deg, rgba(3,20,37,.97), rgba(3,20,37,.05) 100%);
}

.lab-contact-visual-content {
    position: relative;
    z-index: 2;
}

.lab-contact-visual h3 {
    margin: 0 0 12px;
    color: #fff;
    font: 800 29px/1.3 "Manrope", sans-serif;
}

.lab-contact-visual p {
    margin: 0 0 22px;
    color: #d0e1ee;
    font-size: 14px;
    line-height: 1.9;
}

.lab-contact-points {
    display: grid;
    gap: 12px;
}

.lab-contact-point {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
}

.lab-contact-point-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,.14);
    font-size: 18px;
}

.lab-contact-point strong {
    display: block;
    color: #fff;
    font-size: 12px;
}

.lab-contact-point span {
    display: block;
    color: #c7d8e6;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.lab-whatsapp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 13px 18px;
    border-radius: 10px;
    background: #20bf69;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    transition: .2s ease;
}

.lab-whatsapp-link:hover {
    transform: translateY(-2px);
    background: #13a858;
}

/* FOOTER CTA */

.lab-bottom-cta {
    padding: 0 0 75px;
    background: #f1f5f8;
}

.lab-bottom-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 30px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(16,189,233,.17), transparent 32%),
        linear-gradient(120deg, #071b31, #0a4168);
    color: #fff;
}

.lab-bottom-cta h2 {
    margin: 0 0 7px;
    color: #fff;
    font: 800 23px "Manrope", sans-serif;
}

.lab-bottom-cta p {
    max-width: 690px;
    margin: 0;
    color: #c7d8e6;
    font-size: 13px;
}

.lab-bottom-cta .lab-btn {
    flex-shrink: 0;
    background: #fff;
    color: #073b61;
}

.lab-bottom-cta .lab-btn:hover { background: #c8f5ff; }

/* RESPONSIVE */

@media (max-width: 900px) {
    .lab-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab-coa-card { grid-template-columns: 1fr; }
    .lab-contact-layout { grid-template-columns: 1fr; }
    .lab-contact-visual { min-height: 430px; }
    .lab-table-top { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
    .lab-container { width: calc(100% - 28px); }
    .lab-hero { padding: 55px 0 75px; }
    .lab-hero h1 { letter-spacing: -1px; }
    .lab-hero p { font-size: 14px; }
    .lab-search-card { padding: 18px; border-radius: 16px; }
    .lab-search-form { flex-direction: column; }
    .lab-search-submit { width: 100%; }
    .lab-section, .lab-products-section { padding: 48px 0; }
    .lab-feature-grid { grid-template-columns: 1fr; }
    .lab-coa-card { padding: 23px; }
    .lab-coa-card h2 { font-size: 24px; }
    .lab-coa-form { flex-direction: column; }
    .lab-table-footer { align-items: flex-start; flex-direction: column; }
    .lab-contact-section { padding: 48px 0; }
    .lab-contact-form-side { padding: 24px 18px; }
    .lab-contact-form { grid-template-columns: 1fr; }
    .lab-form-group.full, .lab-contact-submit { grid-column: auto; }
    .lab-contact-visual { min-height: 420px; padding: 23px; }
    .lab-bottom-cta-inner { align-items: stretch; flex-direction: column; padding: 23px; }
    .lab-bottom-cta .lab-btn { width: 100%; }
    .lab-copy h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
</style>
</head>

<body>
<div class="lab-page">

<?php include __DIR__ . '/header.php'; ?>

<!-- HERO -->
<section class="lab-hero">
    <div class="lab-container">
        <span class="lab-eyebrow">
            <span class="lab-eyebrow-dot"></span>
            Laboratory & Research Chemicals
        </span>

        <h1>Laboratory Chemicals<br><span>Made for Precision.</span></h1>

        <p>
            Explore laboratory chemicals across AR, LR, HPLC and other listed
            grades. Search by product name or CAS number, and contact our team
            for product quotations and Certificate of Analysis requests.
        </p>

        <nav class="lab-breadcrumb" aria-label="Breadcrumb">
            <a href="index.php">Home</a>
            <span>/</span>
            <span aria-current="page">Lab Chemicals</span>
        </nav>
    </div>
</section>

<!-- PRODUCT SEARCH -->
<section class="lab-search-section">
    <div class="lab-container">
        <div class="lab-search-card">
            <h2 class="lab-search-heading">Find a Laboratory Chemical</h2>
            <p class="lab-search-subtitle">
                Search the products listed on this page by name, CAS number, code or grade.
            </p>

            <div class="lab-tabs" role="group" aria-label="Search options">
                <button type="button" class="lab-tab active" data-mode="all">A–Z / All</button>
                <button type="button" class="lab-tab" data-mode="chemist">Product Name</button>
                <button type="button" class="lab-tab" data-mode="cas">CAS Number</button>
                <button type="button" class="lab-tab" data-mode="application">Grade / Code</button>
            </div>

            <form class="lab-search-form" id="labSearchForm">
                <div class="lab-search-input-wrap">
                    <span class="lab-search-icon" aria-hidden="true">⌕</span>
                    <input
                        class="lab-search-input"
                        type="search"
                        id="labSearchInput"
                        placeholder="Search product name, CAS No, code or grade..."
                        autocomplete="off"
                        aria-label="Search laboratory chemical products"
                    >
                </div>

                <button class="lab-btn lab-btn-primary lab-search-submit" type="submit">
                    Search Products <span aria-hidden="true">→</span>
                </button>
            </form>

            <div class="lab-search-hint">
                Search results update instantly. Clear the search field to display all listed products.
            </div>
        </div>
    </div>
</section>

<!-- INTRO / FEATURES -->
<section class="lab-section">
    <div class="lab-container">
        <div class="lab-section-heading">
            <span class="lab-section-label">Laboratory Solutions</span>
            <h2>Quality, Consistency & Product Information</h2>
            <p>
                Choose products according to your laboratory requirements.
                Our team can help with product details, grade information,
                quotation requests and available batch documentation.
            </p>
        </div>

        <div class="lab-feature-grid">
            <article class="lab-feature">
                <div class="lab-feature-icon" aria-hidden="true">⚗</div>
                <h3>Multiple Chemical Grades</h3>
                <p>
                    Browse listed AR, LR, HPLC and solvent products to identify
                    the grade relevant to your application.
                </p>
            </article>

            <article class="lab-feature">
                <div class="lab-feature-icon" aria-hidden="true">⌕</div>
                <h3>Quick Product Search</h3>
                <p>
                    Find listed products using their name, CAS number, code or grade
                    without leaving this page.
                </p>
            </article>

            <article class="lab-feature">
                <div class="lab-feature-icon" aria-hidden="true">✓</div>
                <h3>Documentation Requests</h3>
                <p>
                    Send a COA or quotation request with product and batch details
                    directly to our team on WhatsApp.
                </p>
            </article>
        </div>
    </div>
</section>

<!-- COA LOOKUP -->
<section class="lab-section lab-section-soft" id="coa">
    <div class="lab-container">
        <div class="lab-coa-card">
            <div>
                <span class="lab-section-label">Batch Documentation</span>
                <h2>Request a Certificate of Analysis</h2>
                <p>
                    Enter your batch number to prepare a COA enquiry on WhatsApp.
                    Please include the relevant product details so our team can
                    review your request. A document is not automatically generated
                    or verified by this form.
                </p>
            </div>

            <form class="lab-coa-form" id="labCoaForm">
                <input
                    class="lab-input"
                    type="text"
                    id="labBatchNumber"
                    placeholder="Enter Batch Number"
                    maxlength="100"
                    required
                    aria-label="Batch number"
                >
                <button class="lab-btn lab-btn-primary" type="submit">
                    Request COA <span aria-hidden="true">↗</span>
                </button>
            </form>
        </div>
    </div>
</section>

<!-- PRODUCT TABLE -->
<section class="lab-products-section" id="products">
    <div class="lab-container">
        <div class="lab-table-top">
            <div>
                <span class="lab-section-label">Product Directory</span>
                <h2>Laboratory Chemical Products</h2>
                <p>
                    Search the sample products below or contact us to enquire about
                    additional products and available grades.
                </p>
            </div>

            <span class="lab-result-count" id="labResultCount">8 Products</span>
        </div>

        <div class="lab-table-card">
            <div class="lab-table-scroll">
                <table class="lab-table" id="labProductTable">
                    <thead>
                        <tr>
                            <th>Product Name</th>
                            <th>CAS No.</th>
                            <th>Documentation</th>
                            <th>Code</th>
                            <th>Grade</th>
                            <th>Quotation</th>
                        </tr>
                    </thead>

                    <tbody>
                        <tr data-name="Acetamide LR" data-cas="60-35-5" data-code="-" data-grade="LR">
                            <td class="lab-product-name">Acetamide LR</td>
                            <td class="lab-cas">60-35-5</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">LR</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetanilide LR" data-cas="103-84-4" data-code="-" data-grade="LR">
                            <td class="lab-product-name">Acetanilide LR</td>
                            <td class="lab-cas">103-84-4</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">LR</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetic Acid Dry Solvent" data-cas="64-19-7" data-code="-" data-grade="Solvent">
                            <td class="lab-product-name">Acetic Acid (Dry Solvent)</td>
                            <td class="lab-cas">64-19-7</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">Solvent</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetic Acid HPLC" data-cas="64-19-7" data-code="-" data-grade="HPLC">
                            <td class="lab-product-name">Acetic Acid HPLC</td>
                            <td class="lab-cas">64-19-7</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">HPLC</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Aceto Carmine Stain Solution" data-cas="-" data-code="-" data-grade="Solution">
                            <td class="lab-product-name">Aceto Carmine Stain Solution</td>
                            <td class="lab-cas">—</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">Solution</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetone Dry Solvent" data-cas="67-64-1" data-code="-" data-grade="Solvent">
                            <td class="lab-product-name">Acetone (Dry Solvent)</td>
                            <td class="lab-cas">67-64-1</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">Solvent</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetone HPLC" data-cas="67-64-1" data-code="-" data-grade="HPLC">
                            <td class="lab-product-name">Acetone HPLC</td>
                            <td class="lab-cas">67-64-1</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">HPLC</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>

                        <tr data-name="Acetone AR" data-cas="67-64-1" data-code="-" data-grade="AR">
                            <td class="lab-product-name">Acetone AR</td>
                            <td class="lab-cas">67-64-1</td>
                            <td><button type="button" class="lab-action-btn lab-coa-product">Request COA</button></td>
                            <td>—</td>
                            <td><span class="lab-grade">AR</span></td>
                            <td><button type="button" class="lab-action-btn lab-quote-btn">Get a Quote</button></td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="lab-no-results" id="labNoResults" role="status">
                <strong>No matching products found</strong>
                Try a different product name, CAS number, code or grade.
                <br><br>
                <button type="button" class="lab-btn lab-btn-primary" id="labClearSearch">
                    Clear Search
                </button>
            </div>

            <div class="lab-table-footer">
                <span id="labTableFooterText">Showing 8 listed products</span>
                <span>Need another product? Contact our team for assistance.</span>
            </div>
        </div>
    </div>
</section>

<!-- SEO / INFORMATION -->
<section class="lab-section lab-section-soft">
    <div class="lab-container">
        <div class="lab-copy">
            <span class="lab-section-label">About Our Range</span>
            <h2>Laboratory Chemicals for Research and Industry</h2>

            <p>
                Oppulent Chemicalls offers a range of laboratory chemicals intended
                for customers across research, education, testing and industrial
                environments. The listed product range includes different grades,
                such as AR, LR and HPLC, subject to individual product availability
                and specifications.
            </p>

            <p>
                Choosing the right laboratory chemical starts with confirming the
                product name, CAS number, grade, required quantity and intended
                application. Customers are encouraged to review the relevant product
                specification and safety documentation before placing an order.
            </p>

            <h3>Product Enquiries and COA Requests</h3>

            <p>
                To request a quotation, share the product name, grade, quantity and
                delivery location. For a Certificate of Analysis enquiry, provide
                the product name and batch number. Our team can review the request
                and confirm what documentation is available for the relevant batch.
            </p>

            <h3>Explore More Chemical Categories</h3>

            <p>
                You can also explore our
                <a href="performance-chemicals.php">performance chemicals</a>
                section for additional product categories. For product availability,
                specifications, pricing or other questions, use the contact form
                below to send an enquiry directly to our team.
            </p>
        </div>
    </div>
</section>

<!-- CONTACT FORM -->
<section class="lab-contact-section" id="contact">
    <div class="lab-container">
        <div class="lab-contact-layout">

            <div class="lab-contact-form-side">
                <div class="lab-contact-heading">
                    <span class="lab-section-label">Let's Talk Chemicals</span>
                    <h2>Send Your Enquiry</h2>
                    <p>
                        Complete the form and continue to WhatsApp with your enquiry
                        details ready to send.
                    </p>
                </div>

                <form class="lab-contact-form" id="labContactForm">
                    <div class="lab-form-group">
                        <label for="labName">Full Name *</label>
                        <input class="lab-input" id="labName" name="name" type="text"
                               placeholder="Your full name" maxlength="100" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labEmail">Email Address *</label>
                        <input class="lab-input" id="labEmail" name="email" type="email"
                               placeholder="you@company.com" maxlength="150" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labPhone">Mobile Number *</label>
                        <input class="lab-input" id="labPhone" name="mobile" type="tel"
                               placeholder="+91 mobile number" maxlength="25" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labCompany">Company *</label>
                        <input class="lab-input" id="labCompany" name="company" type="text"
                               placeholder="Company name" maxlength="150" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labLocation">Location *</label>
                        <input class="lab-input" id="labLocation" name="location" type="text"
                               placeholder="City / Country" maxlength="150" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labProduct">Product Required *</label>
                        <input class="lab-input" id="labProduct" name="product" type="text"
                               placeholder="Product name / CAS No." maxlength="150" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labQuantity">Required Quantity *</label>
                        <input class="lab-input" id="labQuantity" name="quantity" type="text"
                               placeholder="e.g. 5 kg / 25 L" maxlength="80" required>
                    </div>

                    <div class="lab-form-group">
                        <label for="labGrade">Required Grade</label>
                        <select class="lab-input" id="labGrade" name="grade">
                            <option value="">Select grade</option>
                            <option value="AR">AR</option>
                            <option value="LR">LR</option>
                            <option value="HPLC">HPLC</option>
                            <option value="Solvent">Solvent</option>
                            <option value="Other">Other / Not sure</option>
                        </select>
                    </div>

                    <div class="lab-form-group full">
                        <label for="labMessage">Message</label>
                        <textarea class="lab-input" id="labMessage" name="message"
                                  placeholder="Tell us about your product or documentation requirements..."
                                  maxlength="1500"></textarea>
                    </div>

                    <button class="lab-btn lab-contact-submit" type="submit">
                        Continue to WhatsApp <span aria-hidden="true">↗</span>
                    </button>
                </form>
            </div>

            <div class="lab-contact-visual">
                <img
                    src="assets/images/building.jpg"
                    alt="Oppulent Chemicalls"
                    loading="lazy"
                    onerror="this.style.display='none';"
                >

                <div class="lab-contact-visual-content">
                    <span class="lab-eyebrow">
                        <span class="lab-eyebrow-dot"></span>
                        Direct Enquiry Support
                    </span>

                    <h3>Let's Find the Right Product for Your Needs.</h3>

                    <p>
                        Share your product, grade and quantity requirements.
                        Our team can follow up regarding product information,
                        quotations and available documentation.
                    </p>

                    <div class="lab-contact-points">
                        <div class="lab-contact-point">
                            <span class="lab-contact-point-icon" aria-hidden="true">✓</span>
                            <div>
                                <strong>Product Enquiries</strong>
                                <span>Share product name, CAS number and grade.</span>
                            </div>
                        </div>

                        <div class="lab-contact-point">
                            <span class="lab-contact-point-icon" aria-hidden="true">▤</span>
                            <div>
                                <strong>COA Requests</strong>
                                <span>Include the batch number for reference.</span>
                            </div>
                        </div>

                        <div class="lab-contact-point">
                            <span class="lab-contact-point-icon" aria-hidden="true">↗</span>
                            <div>
                                <strong>Quotation Requests</strong>
                                <span>Tell us your required quantity and location.</span>
                            </div>
                        </div>
                    </div>

                    <a
                        class="lab-whatsapp-link"
                        href="https://wa.me/917428465992"
                        target="_blank"
                        rel="noopener noreferrer"
                    >
                        <span aria-hidden="true">◉</span>
                        Chat on WhatsApp
                    </a>
                </div>
            </div>

        </div>
    </div>
</section>

<section class="lab-bottom-cta">
    <div class="lab-container">
        <div class="lab-bottom-cta-inner">
            <div>
                <h2>Looking for a Specific Laboratory Chemical?</h2>
                <p>
                    Send the product name, CAS number or required grade and
                    let our team know what you need.
                </p>
            </div>

            <a class="lab-btn" href="https://wa.me/917428465992"
               target="_blank" rel="noopener noreferrer">
                Enquire on WhatsApp <span aria-hidden="true">↗</span>
            </a>
        </div>
    </div>
</section>

<?php include __DIR__ . '/footer.php'; ?>

</div>

<script>
(function () {
    'use strict';

    /*
     * WhatsApp number:
     * India +91 74284 65992
     * International format must contain digits only.
     */
    const WHATSAPP_NUMBER = '917428465992';

    const searchForm = document.getElementById('labSearchForm');
    const searchInput = document.getElementById('labSearchInput');
    const table = document.getElementById('labProductTable');
    const tableRows = Array.from(table.querySelectorAll('tbody tr'));
    const count = document.getElementById('labResultCount');
    const footerText = document.getElementById('labTableFooterText');
    const noResults = document.getElementById('labNoResults');
    const clearButton = document.getElementById('labClearSearch');
    const tabs = Array.from(document.querySelectorAll('.lab-tab'));

    let searchMode = 'all';

    function normalize(value) {
        return String(value || '').toLowerCase().trim();
    }

    function applySearch() {
        const query = normalize(searchInput.value);
        let visible = 0;

        tableRows.forEach(function (row) {
            const name = normalize(row.dataset.name);
            const cas = normalize(row.dataset.cas);
            const code = normalize(row.dataset.code);
            const grade = normalize(row.dataset.grade);

            let searchable = '';

            if (searchMode === 'chemist') {
                searchable = name;
            } else if (searchMode === 'cas') {
                searchable = cas;
            } else if (searchMode === 'application') {
                searchable = grade + ' ' + code;
            } else {
                searchable = name + ' ' + cas + ' ' + code + ' ' + grade;
            }

            const matches = query === '' || searchable.includes(query);

            row.hidden = !matches;

            if (matches) {
                visible++;
            }
        });

        count.textContent = visible + (visible === 1 ? ' Product' : ' Products');
        footerText.textContent = 'Showing ' + visible + ' of ' + tableRows.length + ' listed products';

        noResults.style.display = visible === 0 ? 'block' : 'none';
        table.style.display = visible === 0 ? 'none' : 'table';
    }

    searchInput.addEventListener('input', applySearch);

    searchForm.addEventListener('submit', function (event) {
        event.preventDefault();
        applySearch();
        document.getElementById('products').scrollIntoView({
            behavior: 'smooth',
            block: 'start'
        });
    });

    tabs.forEach(function (tab) {
        tab.addEventListener('click', function () {
            searchMode = tab.dataset.mode || 'all';

            tabs.forEach(function (otherTab) {
                otherTab.classList.toggle('active', otherTab === tab);
            });

            const placeholders = {
                all: 'Search product name, CAS No, code or grade...',
                chemist: 'Search by product name...',
                cas: 'Enter CAS number, e.g. 67-64-1...',
                application: 'Search by grade or product code...'
            };

            searchInput.placeholder = placeholders[searchMode] || placeholders.all;
            applySearch();
            searchInput.focus();
        });
    });

    clearButton.addEventListener('click', function () {
        searchInput.value = '';
        searchMode = 'all';

        tabs.forEach(function (tab) {
            tab.classList.toggle('active', tab.dataset.mode === 'all');
        });

        searchInput.placeholder = 'Search product name, CAS No, code or grade...';
        applySearch();
        searchInput.focus();
    });

    function openWhatsApp(message) {
        const url = 'https://wa.me/' + WHATSAPP_NUMBER +
            '?text=' + encodeURIComponent(message);

        window.open(url, '_blank', 'noopener,noreferrer');
    }

    function getRowDetails(row) {
        return {
            name: row.dataset.name || 'Not specified',
            cas: row.dataset.cas || 'Not specified',
            code: row.dataset.code || 'Not specified',
            grade: row.dataset.grade || 'Not specified'
        };
    }

    /*
     * Product COA buttons
     */
    document.querySelectorAll('.lab-coa-product').forEach(function (button) {
        button.addEventListener('click', function () {
            const row = button.closest('tr');
            const product = getRowDetails(row);

            const message =
                'Hello Oppulent Chemicalls,\n\n' +
                'I would like to request COA information for the following product:\n\n' +
                'Product: ' + product.name + '\n' +
                'CAS No.: ' + product.cas + '\n' +
                'Grade: ' + product.grade + '\n' +
                'Batch Number: [Please confirm / enter batch number]\n\n' +
                'Please let me know the available documentation.';

            openWhatsApp(message);
        });
    });

    /*
     * Product quotation buttons
     */
    document.querySelectorAll('.lab-quote-btn').forEach(function (button) {
        button.addEventListener('click', function () {
            const row = button.closest('tr');
            const product = getRowDetails(row);

            const message =
                'Hello Oppulent Chemicalls,\n\n' +
                'Please share a quotation for this laboratory chemical:\n\n' +
                'Product: ' + product.name + '\n' +
                'CAS No.: ' + product.cas + '\n' +
                'Grade: ' + product.grade + '\n' +
                'Quantity Required: [Please specify]\n' +
                'Delivery Location: [Please specify]\n\n' +
                'Kindly confirm availability, pack size and pricing.';

            openWhatsApp(message);
        });
    });

    /*
     * COA batch lookup form
     */
    document.getElementById('labCoaForm').addEventListener('submit', function (event) {
        event.preventDefault();

        const batch = document.getElementById('labBatchNumber').value.trim();

        if (!batch) {
            document.getElementById('labBatchNumber').focus();
            return;
        }

        const message =
            'Hello Oppulent Chemicalls,\n\n' +
            'I would like to enquire about a Certificate of Analysis (COA).\n\n' +
            'Batch Number: ' + batch + '\n' +
            'Product Name: [Please specify]\n\n' +
            'Please confirm whether the COA is available for this batch.';

        openWhatsApp(message);
    });

    /*
     * Contact form:
     * No details are stored by this page. WhatsApp opens with a
     * pre-filled draft; the visitor must press Send in WhatsApp.
     */
    document.getElementById('labContactForm').addEventListener('submit', function (event) {
        event.preventDefault();

        const form = event.currentTarget;

        if (!form.reportValidity()) {
            return;
        }

        const data = new FormData(form);

        const fields = [
            ['Name', data.get('name')],
            ['Email', data.get('email')],
            ['Mobile', data.get('mobile')],
            ['Company', data.get('company')],
            ['Location', data.get('location')],
            ['Product Required', data.get('product')],
            ['Quantity', data.get('quantity')],
            ['Grade', data.get('grade') || 'Not specified'],
            ['Message', data.get('message') || 'Not provided']
        ];

        let message = 'Hello Oppulent Chemicalls,\n\nI would like to make a laboratory chemical enquiry.\n\n';

        fields.forEach(function (field) {
            message += field[0] + ': ' + String(field[1] || '').trim() + '\n';
        });

        message += '\nPlease contact me regarding product availability and quotation.';

        openWhatsApp(message);
    });

    /*
     * If the page URL contains a search query, apply it.
     */
    const params = new URLSearchParams(window.location.search);
    const initialQuery = params.get('search_query') || params.get('q');

    if (initialQuery) {
        searchInput.value = initialQuery;
        applySearch();
        document.getElementById('products').scrollIntoView({
            behavior: 'smooth',
            block: 'start'
        });
    }
})();
</script>

</body>
</html>
