<?php 
// Get category from URL parameter
$category = isset($_GET['category']) ? $_GET['category'] : 'laboratory-glassware';

// Set page title and hero content based on category
$categoryTitles = [
    'forensic' => ['title' => 'Forensic Products', 'subtitle' => 'SPECIALIZED FORENSIC SOLUTIONS', 'description' => 'Discover A Wide Range Of High-Quality Forensic Analysis<br>Equipment And Tools For Criminal Investigation And Evidence Processing'],
    'virology' => ['title' => 'Virology Products', 'subtitle' => 'ADVANCED VIRAL TESTING', 'description' => 'Discover A Wide Range Of High-Quality Viral Testing<br>Kits And Equipment For Accurate Diagnosis And Research Applications'],
    'histology' => ['title' => 'Histology Products', 'subtitle' => 'COMPREHENSIVE HISTOLOGICAL SOLUTIONS', 'description' => 'Discover A Wide Range Of High-Quality Histological<br>Stains, Reagents, And Equipment For Tissue Examination'],
    'cardiac' => ['title' => 'Cardiac Products', 'subtitle' => 'CARDIAC DIAGNOSTIC SOLUTIONS', 'description' => 'Discover A Wide Range Of High-Quality Cardiac Markers<br>And Diagnostic Tools For Heart Disease Detection And Monitoring'],
    'transport-media' => ['title' => 'Transport Media', 'subtitle' => 'SPECIMEN PRESERVATION SOLUTIONS', 'description' => 'Discover A Wide Range Of High-Quality Transport Media<br>For Specimen Preservation And Safe Sample Handling'],
    'laboratory-glassware' => ['title' => 'Laboratory Glassware', 'subtitle' => 'LABORATORY GLASSWARE SOLUTIONS', 'description' => 'Discover A Wide Range Of High-Quality Laboratory<br>Glassware Including Beakers, Flasks, Test Tubes, And Measuring Equipment']
];

$currentCategory = $categoryTitles[$category] ?? $categoryTitles['laboratory-glassware'];
$pageTitle = $currentCategory['title'] . " - Sigma Healthcare";
?>
<?php include 'includes/header.php'; ?>

<style>
/* Enhanced product layout with proper outline borders */
.product-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    display: block;
    
    /* FIXED PROPER OUTLINE BORDER */
    border: 3px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.product-item:hover {
    transform: translateY(-8px);
    text-decoration: none;
    color: inherit;
    
    /* ENHANCED HOVER BORDER */
    border-color: #FE4600;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15), 0 0 0 1px #FE4600;
}

.product-item:focus {
    outline: none;
    border-color: #FE4600;
    box-shadow: 0 0 0 3px rgba(254, 70, 0, 0.2);
}

.product-image {
    height: 250px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fafafa;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Clear separation between image and text */
    border-bottom: 2px solid #f0f0f0;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 60%, rgba(254, 70, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-item:hover .product-image::before {
    opacity: 1;
}

/* Enhanced product info section */
.product-info {
    padding: 20px 15px;
    text-align: center;
    background: white;
    position: relative;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info h5 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
    line-height: 1.3;
    text-align: center;
}

.product-item:hover .product-info h5 {
    color: #FE4600;
}

/* Optional accent line animation */
.product-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #FE4600;
    transition: width 0.3s ease;
}

.product-item:hover .product-info::after {
    width: 60%;
}

/* Products Hero Section - Updated to match other pages */
.products-hero-section {
    background: url('images/products/product-hero.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 120px;
}

.products-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.products-hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    max-width: 600px;
}

.products-hero-title {
    color: #07427D;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.products-hero-subtitle {
    color: #1B4763;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.products-hero-description {
    color: #1B4763;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    opacity: 0.9;
}

/* Animation Classes */
.slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

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

.fade-in-delayed {
    animation: fadeInDelayed 1s ease-out 0.3s both;
}

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

/* Filter Section */
.filter-section {
    padding: 50px 0;
    background: #ffffff;
    margin-top: -100px;
    position: relative;
    z-index: 3;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .products-hero-title {
        font-size: 3.5rem;
    }
    
    .product-item {
        border-width: 2px;
    }
}

@media (max-width: 992px) {
    .products-hero-title {
        font-size: 3rem;
    }
    
    .products-hero-section {
        min-height: 80vh;
        padding-top: 100px;
    }
    
    .product-item {
        border-width: 2px;
    }
}

@media (max-width: 768px) {
    .product-image {
        height: 220px;
        background-size: contain;
    }
    
    .product-info {
        padding: 18px 12px;
        min-height: 70px;
    }
    
    .product-info h5 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .products-hero-title {
        font-size: 2.5rem;
        text-align: center;
    }
    
    .products-hero-subtitle {
        font-size: 1rem;
        text-align: center;
    }
    
    .products-hero-description {
        text-align: center;
    }
    
    .products-hero-content {
        text-align: center;
    }
    
    .products-hero-section {
        min-height: 70vh;
        padding: 100px 0 60px;
        margin-top: 15px;
    }
    
    .filter-section {
        padding: 60px 0;
        margin-top: -80px;
    }
    
    /* Maintain border on tablet */
    .product-item {
        border-width: 2px;
    }
}

@media (max-width: 576px) {
    .product-image {
        height: 200px;
        background-size: contain;
    }
    
    .product-info {
        padding: 15px 10px;
        min-height: 65px;
    }
    
    .product-info h5 {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .products-hero-title {
        font-size: 2rem;
        text-align: center;
    }
    
    .products-hero-description {
        font-size: 0.9rem;
        text-align: center;
    }
    
    .products-hero-section {
        padding: 90px 0 50px;
        margin-top: 15px;
    }

    /* Slightly thinner border on mobile but still visible */
    .product-item {
        border-width: 2px;
        margin-bottom: 20px;
    }
}

@media (max-width: 375px) {
    .products-hero-section {
        min-height: 60vh;
        padding: 100px 0 40px;
        margin-top: 15px;
    }
    
    .products-hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .products-hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .products-hero-description {
        font-size: 0.85rem;
        line-height: 1.5;
        text-align: center;
        br {
            display: none;
        }
    }
    
    .filter-section {
        padding: 40px 0;
        margin-top: -60px;
    }
    
    .filter-section h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .product-image {
        height: 180px;
        background-size: contain;
    }
    
    .product-info {
        padding: 12px 8px;
        min-height: 60px;
    }
    
    .product-info h5 {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .product-item {
        margin-bottom: 15px;
        border-width: 2px; /* Keep consistent border */
    }
    
    .col-lg-4.col-md-6 {
        padding: 0 8px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 320px) {
    .products-hero-title {
        font-size: 1.6rem;
    }
    
    .products-hero-description {
        font-size: 0.8rem;
    }
    
    .product-image {
        height: 160px;
        background-size: contain;
    }
    
    .product-info h5 {
        font-size: 0.85rem;
        line-height: 1.1;
    }
    
    .filter-section h2 {
        font-size: 1.2rem;
    }
    
    .product-item {
        border-width: 2px;
    }
}

/* Ensure consistent spacing */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Additional hover effects for better UX */
.product-item:active {
    transform: translateY(-5px);
    transition: transform 0.1s ease;
}
</style>

<!-- Products Hero Section -->
<section class="products-hero-section">
    <div class="container">
        <div class="row">
            <div class="col-lg-6">
                <div class="products-hero-content slide-in-left">
                    <h1 class="products-hero-title"><?php echo strtoupper($currentCategory['title']); ?></h1>
                    <p class="products-hero-subtitle"><?php echo $currentCategory['subtitle']; ?></p>
                    <p class="products-hero-description">
                        <?php echo $currentCategory['description']; ?>
                    </p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Filter Section -->
<section class="filter-section">
    <div class="container">
        <div class="row align-items-center">
            <div class="col-lg-12">
                <h2><?php echo $currentCategory['title']; ?></h2>
            </div>
        </div>
    </div>
</section>

<!-- Products Grid -->
<section style="padding: 0 0 80px;">
    <div class="container">
        <div class="row">
            <!-- NEW RAPID TEST PRODUCTS - Added at the beginning -->
            <!-- First Row - New Rapid Test Products -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=cocaine-coc-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Cocaine (COC) Rapid Test Cassette.jpg');"></div>
                    <div class="product-info">
                        <h5>Cocaine (COC) Rapid Test Cassette</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=dengue-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Dengue Rapid Test Cassette.jpg');"></div>
                    <div class="product-info">
                        <h5>Dengue Rapid Test Cassette</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=hbsag-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/HBsAg Rapid Test Cassette.jpg');"></div>
                    <div class="product-info">
                        <h5>HBsAg Rapid Test Cassette</h5>
                    </div>
                </a>
            </div>

            <!-- Second Row - More New Rapid Test Products -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=hiv-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/HIV 1.2 Rapid Test Cassette.jpg');"></div>
                    <div class="product-info">
                        <h5>HIV 1,2 Rapid Test Cassette</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=marijuana-thc-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Marijuana (THC) Rapid Test (Urine).jpg');"></div>
                    <div class="product-info">
                        <h5>Marijuana (THC) Rapid Test (Urine)</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=methamphetamine-met-rapid-test" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Methamphetamine (MET) Rapid Test (Urine).jpg');"></div>
                    <div class="product-info">
                        <h5>Methamphetamine (MET) Rapid Test (Urine)</h5>
                    </div>
                </a>
            </div>

            <!-- ORIGINAL PRODUCTS CONTINUE BELOW -->
            <!-- Third Row - Glass Beakers -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=glass-beaker-25ml" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/beaker25.jpg');"></div>
                    <div class="product-info">
                        <h5>Glass Beaker 25mL</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=glass-beaker-50ml" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/beaker50.png');"></div>
                    <div class="product-info">
                        <h5>Glass Beaker 50mL</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=glass-beaker-100ml" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/beker100.jpeg');"></div>
                    <div class="product-info">
                        <h5>Glass Beaker 100mL</h5>
                    </div>
                </a>
            </div>
            
            <!-- Fourth Row - More Glass Products -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=glass-beaker-250ml" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/beker250.jpeg');"></div>
                    <div class="product-info">
                        <h5>Glass Beaker 250mL</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=vacutainer-1" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Vacutainers.jpg');"></div>
                    <div class="product-info">
                        <h5>Vacutainer Blood Collection Tube</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=vacutainer-2" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Vacutainer.jpeg');"></div>
                    <div class="product-info">
                        <h5>Vacutainer EDTA Tube</h5>
                    </div>
                </a>
            </div>

            <!-- Fifth Row - Laboratory Equipment -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=vacutainer-4" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/Vacutainer- heparin.jpeg');"></div>
                    <div class="product-info">
                        <h5>Vacutainer Heparin Tube</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=petri-dish" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/petri-dish.jpeg');"></div>
                    <div class="product-info">
                        <h5>Petri Dish</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=pipettes" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/pipette.jpeg');"></div>
                    <div class="product-info">
                        <h5>Pipettes</h5>
                    </div>
                </a>
            </div>

            <!-- Sixth Row - Test Tubes and Flasks -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=test-tubes" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/testtubes.jpg');"></div>
                    <div class="product-info">
                        <h5>Test Tubes</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=test-tube-rack-2" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/testube-rack.jpg');"></div>
                    <div class="product-info">
                        <h5>Test Tube Rack</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=conical-flask" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/conical-flask.jpg');"></div>
                    <div class="product-info">
                        <h5>Conical Flask</h5>
                    </div>
                </a>
            </div>

            <!-- Seventh Row - Specialized Flasks -->
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=erlenmeyer-flask" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/250_mL_Erlenmeyer_flask.jpg');"></div>
                    <div class="product-info">
                        <h5>Erlenmeyer Flask</h5>
                    </div>
                </a>
            </div>

            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=vacutainer-5" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/vflask.jpeg');"></div>
                    <div class="product-info">
                        <h5>Volumetric Flask</h5>
                    </div>
                </a>
            </div>
            
            <div class="col-lg-4 col-md-6 mb-4">
                <a href="product-detail.php?id=glass-beaker-1000ml" class="product-item">
                    <div class="product-image" style="background-image: url('images/products/round-flask.png');"></div>
                    <div class="product-info">
                        <h5>Round-flask</h5>
                    </div>
                </a>
            </div>
        </div>
    </div>
</section>

<?php include 'includes/footer.php'; ?>