<?php
$this->assign('title', 'Track Shipment');
?>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">

<div class="booking-page">
    <section class="booking-hero-section">
        <div class="booking-hero-overlay"></div>

        <nav class="navbar navbar-expand-lg hero-navbar">
            <div class="container-fluid hero-nav-container">
                <a class="navbar-brand brand-link" href="<?= $this->Url->build('/') ?>">
                    <?= $this->Html->image('impeccable-logo.png', [
                        'alt' => 'Impeccable Courier',
                        'class' => 'brand-logo'
                    ]) ?>
                </a>

                <button class="navbar-toggler custom-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#heroNavbar" aria-controls="heroNavbar" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse justify-content-end" id="heroNavbar">
                    <ul class="navbar-nav align-items-lg-center hero-menu">
                        <li class="nav-item">
                            <a class="nav-link" href="<?= $this->Url->build('/') ?>">Home</a>
                        </li>

                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle active-nav-link" href="#" id="servicesDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                Services
                            </a>
                            <ul class="dropdown-menu custom-dropdown" aria-labelledby="servicesDropdown">
                                <li><a class="dropdown-item" href="<?= $this->Url->build('/booking') ?>">Book a Shipment</a></li>
                                <li><a class="dropdown-item" href="#">Track a Shipment</a></li>
                                <li><a class="dropdown-item" href="<?= $this->Url->build('/') ?>#volumetricSection">Volumetric Weight Calculator</a></li>
                            </ul>
                        </li>

                        <li class="nav-item">
                            <a class="nav-link" href="<?= $this->Url->build('/contact') ?>">Contact Us</a>
                        </li>

                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="helpDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                                Help
                            </a>
                            <ul class="dropdown-menu custom-dropdown" aria-labelledby="helpDropdown">
                                <li><a class="dropdown-item" href="<?= $this->Url->build('/terms') ?>">Terms and Conditions</a></li>
                                <li><a class="dropdown-item" href="<?= $this->Url->build('/restricted-cargos') ?>">Restricted Cargos</a></li>
                            </ul>
                        </li>

                        <li class="nav-item nav-login-item">
                            <?php
                            if (!$this->Identity->isLoggedIn()) {
                                echo $this->Html->link('Log in', ['controller' => 'Auth', 'action' => 'login'], ['class' => 'btn login-btn']);
                            }
                            ?>
                        </li>

                        <li class="nav-item nav-login-item">
                            <?php
                            if ($this->Identity->isLoggedIn()) {
                                echo $this->Html->link('Logout', ['controller' => 'Auth', 'action' => 'logout'], ['class' => 'btn login-btn']);
                            }
                            ?>
                        </li>

                        <li class="nav-item nav-login-item">
                            <?php
                            if ($this->Identity->isLoggedIn()) {
                                echo $this->Html->link('Dashboard', ['prefix' => 'Admin', 'controller' => 'Dashboard', 'action' => 'index'], ['class' => 'btn login-btn']);
                            }
                            ?>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

        <div class="booking-hero-center">
            <h1>Track Shipment</h1>
            <p><a href="<?= $this->Url->build('/') ?>">Home</a> / Track Shipment</p>
        </div>
    </section>

    <section class="booking-main-section">
        <div class="booking-main-container">
            <div class="booking-heading-wrap">
                <h2>Track your shipment</h2>
                <p>
                    Enter your Impeccable Courier reference number to view the latest status
                </p>
            </div>

            <div class="booking-form-card">

                <?= $this->Form->create(null, [
                    'type' => 'post',
                    'class' => 'tracking-form'
                ]) ?>

                <div style="display:flex; gap:12px; align-items:stretch;">
                    <div style="flex:1; display:flex;">
                        <?= $this->Form->control('tracking_number', [
                            'label' => false,
                            'placeholder' => 'Enter tracking number (e.g. CP123456789)',
                            'class' => 'form-control tracking-input',
                            'required' => true,
                            'style' => 'height: 100%; width: 100%; box-sizing: border-box; margin: 0;',
                            'templates' => [
                                'inputContainer' => '{{content}}'
                            ]
                        ]) ?>
                    </div>
                    <button type="submit" class="tracking-btn" style="margin: 0; display: flex; align-items: center; justify-content: center;">
                        Track
                    </button>

                </div>

                <?= $this->Form->end() ?>

                <?php if (!empty($result) || !empty($localBooking)) : ?>
                    <div style="margin-top: 30px; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid #eee; font-family: Arial, sans-serif;">

                        <?php if (!empty($result['success']) && !empty($result['data']['data']['consignmentInfo'])) : ?>

                            <?php $consignmentInfo = $result['data']['data']['consignmentInfo']; ?>

                            <h4 style="color:#c91c1c; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0;">Tracking Result</h4>

                            <?php foreach ($consignmentInfo as $consignment) : ?>
                                <div style="margin-bottom: 30px; border: 1px solid #e0e0e0; border-radius: 12px; overflow: hidden;">

                                    <?php if (!empty($consignment['consignmentCode'])) : ?>
                                        <div style="background: #f8f9fa; padding: 15px 20px; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;">
                                            <strong style="font-size: 16px; color: #333;">Consignment: <?= h($consignment['consignmentCode']) ?></strong>
                                            <?php if (!empty($consignment['status'])) : ?>
                                                <span style="background: #e6f4ea; color: #1e8e3e; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; text-transform: capitalize;">
                                        <?= h($consignment['status']) ?>
                                    </span>
                                            <?php endif; ?>
                                        </div>
                                    <?php endif; ?>

                                    <div style="padding: 20px;">
                                        <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 25px; font-size: 14px; color: #555;">
                                            <?php if (!empty($consignment['deliveryETA'])) : ?>
                                                <div style="flex: 1; min-width: 140px;">
                                                    <strong style="color: #333;">Estimated Delivery:</strong><br><?= h($consignment['deliveryETA']) ?>
                                                </div>
                                            <?php endif; ?>

                                            <?php if (!empty($consignment['deliveredAt'])) : ?>
                                                <div style="flex: 1; min-width: 140px;">
                                                    <strong style="color: #333;">Delivered At:</strong><br><?= h($consignment['deliveredAt']) ?>
                                                </div>
                                            <?php endif; ?>

                                            <?php if (!empty($consignment['POD']) || !empty($consignment['pod'])) : ?>
                                                <div style="flex: 1; min-width: 140px;">
                                                    <strong style="color: #333;">Signed By:</strong><br><?= h($consignment['POD'] ?? $consignment['pod']) ?>
                                                </div>
                                            <?php endif; ?>

                                            <?php if (!empty($consignment['deadWeight'])) : ?>
                                                <div style="flex: 1; min-width: 140px;">
                                                    <strong style="color: #333;">Weight/Volume:</strong><br>
                                                    <?= h($consignment['deadWeight']) ?>
                                                    <?php if (!empty($consignment['volume'])) : ?>
                                                        <br><?= h($consignment['volume']) ?>
                                                    <?php endif; ?>
                                                </div>
                                            <?php endif; ?>
                                        </div>

                                        <?php if (!empty($consignment['itemsCoupons'])) : ?>
                                            <h5 style="font-size: 15px; color: #333; margin-top: 0; margin-bottom: 15px; border-bottom: 1px dashed #ddd; padding-bottom: 10px;">Packages</h5>

                                            <?php foreach ($consignment['itemsCoupons'] as $couponIndex => $coupon) : ?>
                                                <details <?= $couponIndex === 0 ? 'open' : '' ?> style="margin-bottom: 20px; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px;">

                                                    <summary style="padding: 15px; cursor: pointer; list-style: none; outline: none; margin: 0;">
                                                        <div style="display: flex; justify-content: space-between; align-items: center;">
                                                            <div style="font-weight: 600; font-size: 14px; color: #444;">
                                                                Item Code: <?= h($coupon['item']) ?>
                                                            </div>
                                                            <div style="font-size: 12px; color: #999;">
                                                                Click to toggle details
                                                            </div>
                                                        </div>
                                                    </summary>

                                                    <div style="padding: 0 15px 15px 15px; border-top: 1px solid #f0f0f0;">
                                                        <div style="margin-top: 15px;">
                                                            <?php if (!empty($coupon['trackingInfo'])) : ?>
                                                                <div style="margin-left: 10px; border-left: 2px solid #e8e8e8; padding-left: 20px; position: relative;">
                                                                    <?php
                                                                    $trackCount = count($coupon['trackingInfo']);
                                                                    foreach ($coupon['trackingInfo'] as $index => $track) :
                                                                        $isLatest = ($index === $trackCount - 1);
                                                                        ?>
                                                                        <div style="position: relative; margin-bottom: <?= $isLatest ? '0' : '24px' ?>;">
                                                                            <div style="position: absolute; left: -26px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: <?= $isLatest ? '#c91c1c' : '#d9d9d9' ?>; border: 2px solid #fff; box-shadow: 0 0 0 2px <?= $isLatest ? 'rgba(201, 28, 28, 0.2)' : 'transparent' ?>;"></div>

                                                                            <div style="font-size: 13px; font-weight: 600; color: <?= $isLatest ? '#c91c1c' : '#888' ?>; margin-bottom: 4px;">
                                                                                <?= h($track['date'] ?? '') ?> &nbsp; <?= h($track['time'] ?? '') ?>
                                                                            </div>

                                                                            <div style="font-size: 14px; color: <?= $isLatest ? '#333' : '#666' ?>; line-height: 1.5;">
                                                                                <?= h($track['action'] ?? '') ?>
                                                                                <?php if (!empty($track['contractor'])) : ?>
                                                                                    <span style="font-size: 12px; color: #999;">[<?= h($track['contractor']) ?>]</span>
                                                                                <?php endif; ?>
                                                                            </div>
                                                                        </div>
                                                                    <?php endforeach; ?>
                                                                </div>
                                                            <?php else : ?>
                                                                <div style="margin-left: 10px; padding: 10px 0; color: #888; font-size: 13px; font-style: italic;">
                                                                    <i class="bi bi-info-circle" style="margin-right: 5px;"></i> No scan events found.
                                                                </div>
                                                            <?php endif; ?>

                                                        </div>
                                                    </div>
                                                </details>
                                            <?php endforeach; ?>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endforeach; ?>

                        <?php else : ?>
                            <?php if (!empty($localBooking)) : ?>
                                <h4 style="color:#c91c1c; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0;">Booking Status</h4>
                                <div style="border: 1px solid #b3e5fc; border-radius: 12px; padding: 20px;">
                                    <p style="margin: 0 0 10px 0; color: #333;"><strong>Tracking Number:</strong> <?= h($trackingNumber ?? '') ?></p>
                                    <p style="margin: 0; color: #333;">
                                        <strong>Current Status:</strong>
                                        <span style="background: #0288d1; color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; text-transform: capitalize; margin-left: 8px;">
                                <?= h($localBooking->status ?? 'Pending') ?>
                            </span>
                                    </p>
                                    <p style="margin: 15px 0 0 0; font-size: 13px; color: #666;">
                                        * This parcel is registered in our system but has not yet been scanned by the courier network. Check back later for detailed tracking updates.
                                    </p>
                                </div>
                            <?php else : ?>
                                <h4 style="color:#c91c1c;">Tracking Information Not Found</h4>
                                <p style="color:#666; margin:0;">We couldn't locate the specific tracking timeline for this shipment in our system or the courier's network. Please check the tracking number.</p>
                            <?php endif; ?>
                        <?php endif; ?>

                    </div>
                <?php endif; ?>
            </div>

        </div>
    </section>
    <footer style="
    background:#ffffff;
    border-top:1px solid #ffffff;
    padding:70px 40px 50px 40px;
">
        <div style="
        max-width:1480px;
        margin:0 auto;
    ">
            <div style="
            display:flex;
            justify-content:flex-start;
            align-items:flex-start;
            gap:150px;
            flex-wrap:wrap;
            padding-bottom:26px;
            border-bottom:1px solid #d9dde5;
        ">
                <!-- LEFT -->
                <div style="
                flex:1 1 420px;
                min-width:300px;
            ">
                    <div style="margin-bottom:16px;">
                        <?= $this->Html->image('footer-logo.png', [
                            'alt' => 'Impeccable Courier',
                            'style' => 'max-width:640px; width:100%; height:auto; display:block;'
                        ]) ?>
                    </div>

                    <p style="
                    margin:0 0 0 27px;
                    color:#475467;
                    font-size:18px;
                    line-height:1.8;
                    font-weight:400;
                    font-family:var(--font-main);
                    max-width:560px;
                ">
                        Trusted international courier services with affordable rates, secure delivery, and reliable support across Australia, Pakistan, the UK, USA and Canada.
                    </p>
                </div>

                <!-- RIGHT -->
                <div style="
                flex:1 1 760px;
                min-width:320px;
                display:flex;
                justify-content:space-between;
                gap:70px;
                flex-wrap:wrap;
                align-items:flex-start;
            ">
                    <!-- CONTACT + QUICK LINKS -->
                    <div style="
                    min-width:260px;
                    display:flex;
                    flex-direction:column;
                    gap:34px;
                ">
                        <!-- contact -->
                        <div>
                            <h4 style="
                            margin:0 0 16px 0;
                            color:#c91c1c;
                            font-size:20px;
                            font-weight:700;
                            font-family:var(--font-main);
                            text-transform:uppercase;
                            letter-spacing:0.6px;
                        ">
                                Contact
                            </h4>

                            <p style="
                            margin:0 0 12px 0;
                            color:#101828;
                            font-size:18px;
                            line-height:1.8;
                            font-family:var(--font-main);
                        ">
                                <?php
                                $phone = $this->ContentBlock->text('contact-phone');
                                $phoneClean = preg_replace('/\s+/', '', $phone); // removes spaces
                                ?>
                                <strong>Phone:</strong>
                                <a href="tel:<?= h($phoneClean) ?>">
                                    <?= h($phone) ?>
                                </a>
                            </p>

                            <p style="
                            margin:0;
                            color:#101828;
                            font-size:18px;
                            line-height:1.8;
                            font-family:var(--font-main);
                        ">
                                <?php $email = $this->ContentBlock->text('contact-email'); ?>
                                <strong>Email:</strong>
                                <a href="mailto:<?= h($email) ?>">
                                    <?= h($email) ?>
                                </a>
                            </p>
                        </div>

                        <!-- quick links -->
                        <div>
                            <h4 style="
                            margin:0 0 16px 0;
                            color:#c91c1c;
                            font-size:20px;
                            font-weight:700;
                            font-family:var(--font-main);
                            text-transform:uppercase;
                            letter-spacing:0.6px;
                        ">
                                Quick Links
                            </h4>

                            <div style="
                            display:flex;
                            gap:50px;
                            flex-wrap:wrap;
                        ">
                                <!-- left half -->
                                <div style="
                                display:flex;
                                flex-direction:column;
                                gap:12px;
                                min-width:140px;
                            ">
                                    <a href="#"
                                       style="color:#101828; text-decoration:none; font-size:18px; font-family:var(--font-main); transition:color 0.25s ease;"
                                       onmouseover="this.style.color='#c91c1c'"
                                       onmouseout="this.style.color='#101828'">
                                        Home
                                    </a>

                                    <a href="#"
                                       style="color:#101828; text-decoration:none; font-size:18px; font-family:var(--font-main); transition:color 0.25s ease;"
                                       onmouseover="this.style.color='#c91c1c'"
                                       onmouseout="this.style.color='#101828'">
                                        Booking
                                    </a>

                                    <a href="#"
                                       style="color:#101828; text-decoration:none; font-size:18px; font-family:var(--font-main); transition:color 0.25s ease;"
                                       onmouseover="this.style.color='#c91c1c'"
                                       onmouseout="this.style.color='#101828'">
                                        About Us
                                    </a>
                                </div>

                                <!-- right half -->
                                <div style="
                                display:flex;
                                flex-direction:column;
                                gap:12px;
                                min-width:180px;
                            ">
                                    <a href="#"
                                       style="color:#101828; text-decoration:none; font-size:18px; font-family:var(--font-main); transition:color 0.25s ease;"
                                       onmouseover="this.style.color='#c91c1c'"
                                       onmouseout="this.style.color='#101828'">
                                        Contact Us
                                    </a>

                                    <a href="#"
                                       style="color:#101828; text-decoration:none; font-size:18px; font-family:var(--font-main); transition:color 0.25s ease;"
                                       onmouseover="this.style.color='#c91c1c'"
                                       onmouseout="this.style.color='#101828'">
                                        Terms &amp; Condition
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- WAREHOUSE -->
                    <div style="min-width:260px; margin-left:10px;">
                        <h4 style="
                        margin:0 0 16px 0;
                        color:#c91c1c;
                        font-size:20px;
                        font-weight:700;
                        font-family:var(--font-main);
                        text-transform:uppercase;
                        letter-spacing:0.6px;
                    ">
                            Warehouse
                        </h4>

                        <p style="
                        margin:0;
                        color:#101828;
                        font-size:18px;
                        line-height:1.8;
                        font-family:var(--font-main);
                        max-width:340px;
                    ">
                            <a href="https://www.google.com/maps?q=1011+Sydney+Road,+Coburg+North,+Victoria+3047" target="_blank">
                                1011 Sydney Road, Coburg North,<br>
                                Victoria 3047
                            </a>
                        </p>
                    </div>
                </div>
            </div>

            <div style="
            padding-top:18px;
            text-align:center;
        ">
                <p style="
                margin:0;
                color:#c91c1c;
                font-size:18px;
                line-height:1.7;
                font-weight:500;
                font-family:var(--font-main);
            ">
                    © All Rights Reserved by Webspire 2026
                </p>
            </div>
        </div>
    </footer>
</div>

<style>
    :root {
        --font-main: 'Inter', Arial, sans-serif;
        --white: #ffffff;
        --black: #161616;
        --soft-black: #2c2c2c;
        --text-gray: #5d5d5d;
        --accent-red: #c62828;
        --bg-soft: #f7f8fa;
        --border-soft: #d0d5dd;
    }

    * { box-sizing: border-box; }

    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
        font-family: var(--font-main);
        background: #ffffff;
        color: var(--black);
        scroll-behavior: smooth;
    }

    body { min-width: 320px; font-weight: 300; }

    .hero-navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
        padding: 10px 50px;
        background: rgba(8, 8, 8, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .hero-nav-container { align-items: center; }
    .brand-link { margin: 0; padding: 0; }
    .brand-logo { width: 280px; max-width: 100%; height: auto; display: block; }
    .hero-menu { gap: 10px; }
    .hero-menu .nav-link {
        color: #fff;
        font-size: 18px;
        font-weight: 400;
        padding: 10px 12px !important;
    }
    .hero-menu .nav-link:hover { color: var(--accent-red) !important; }
    .active-nav-link { color: #fff !important; }

    .custom-dropdown {
        border: none;
        border-radius: 14px;
        padding: 10px 0;
        box-shadow: 0 12px 28px rgba(0,0,0,0.18);
        min-width: 270px;
    }
    .custom-dropdown .dropdown-item {
        font-size: 15px;
        padding: 12px 18px;
        font-weight: 400;
        font-family: var(--font-main);
    }
    .custom-dropdown .dropdown-item:hover { background: #eef0f4; }

    .nav-login-item { margin-left: 10px; }
    .login-btn {
        background: #fff;
        color: #161616;
        border-radius: 999px;
        padding: 12px 28px;
        font-size: 17px;
        font-weight: 400;
        min-width: 118px;
        border: none;
    }
    .tracking-btn {
        background: #cf2121;
        color: #fff;
        border-radius: 999px;
        padding: 12px 28px;
        font-size: 17px;
        font-weight: 400;
        min-width: 118px;
        border: none;
    }
    .tracking-btn:hover { background: #911919;}
    .login-btn:hover { background: var(--accent-red); color: #fff; }

    .custom-toggler {
        border-color: rgba(255,255,255,0.45);
        background: rgba(255,255,255,0.08);
    }
    .custom-toggler .navbar-toggler-icon { filter: invert(1); }

    .booking-hero-section {
        position: relative;
        min-height: 420px;
        background-image: url('/img/plane3.png');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        overflow: hidden;
    }
    .booking-hero-overlay {
        position: absolute;
        inset: 0;
        background: rgba(44, 44, 44, 0.55);
        z-index: 1;
    }
    .booking-hero-center {
        position: relative;
        z-index: 2;
        min-height: 420px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 120px 20px 60px;
        text-align: center;
    }
    .booking-hero-center h1 {
        margin: 0 0 12px 0;
        color: #fff;
        font-size: 64px;
        line-height: 1.08;
        font-weight: 500;
        letter-spacing: -1px;
    }
    .booking-hero-center p,
    .booking-hero-center a {
        margin: 0;
        color: #fff;
        font-size: 18px;
        line-height: 1.6;
        font-weight: 400;
        text-decoration: none;
    }

    .booking-main-section {
        background: linear-gradient(180deg, #f7f8fa 0%, #eef2f7 100%);
        padding: 70px 36px 100px;
    }
    .booking-main-container {
        max-width: 1280px;
        margin: 0 auto;
    }
    .booking-heading-wrap {
        text-align: center;
        margin-bottom: 42px;
    }
    .booking-heading-wrap h2 {
        margin: 0 0 16px 0;
        color: #101828;
        font-size: 54px;
        line-height: 1.08;
        font-weight: 500;
        letter-spacing: -1px;
    }
    .booking-heading-wrap p {
        max-width: 760px;
        margin: 0 auto;
        color: #667085;
        font-size: 18px;
        line-height: 1.8;
        font-weight: 400;
    }

    .booking-form-card {
        background: rgba(255,255,255,0.92);
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 24px;
        padding: 30px 40px;
        box-shadow: 0 20px 60px rgba(16,24,40,0.08);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .booking-field label {
        display: block;
        margin-bottom: 10px;
        color: #101828;
        font-size: 16px;
        font-weight: 600;
    }
    .booking-field label span { color: var(--accent-red); }

    .booking-field input,
    .booking-field select,
    .booking-field textarea {
        width: 100%;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        background: #fff;
        color: #101828;
        font-size: 17px;
        font-family: var(--font-main);
        outline: none;
        box-shadow: none;
        transition: all 0.25s ease;
    }
    .booking-field input,
    .booking-field select {
        height: 60px;
        padding: 0 18px;
    }
    .booking-field textarea {
        min-height: 140px;
        padding: 16px 18px;
        resize: vertical;
    }
    .booking-field input:focus,
    .booking-field select:focus,
    .booking-field textarea:focus,
    .booking-field input:hover,
    .booking-field select:hover,
    .booking-field textarea:hover {
        border-color: var(--accent-red);
        box-shadow: 0 0 0 0.12rem rgba(201, 28, 28, 0.08);
    }

    .check-wrap input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
        padding: 0;
        flex: 0 0 18px;
        display: inline-block;
        vertical-align: middle;
        position: relative;
        top: 0;
        accent-color: var(--accent-red);
    }

    .check-wrap span {
        display: inline-block !important;
        margin: 0;
        padding: 0;
        font-size: 16px;
        font-weight: 500;
        line-height: 18px !important;
        color: #c91c1c;
        vertical-align: middle;
        position: relative;
        top: -1px;
    }
    .footer-col h4 {
        margin: 0 0 16px 0;
        color: #c91c1c;
        font-size: 20px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
    }
    .footer-col p,
    .footer-col a {
        display: block;
        margin: 0 0 12px 0;
        color: #101828;
        font-size: 18px;
        line-height: 1.8;
        text-decoration: none;
    }
    .footer-col a:hover { color: #c91c1c; }
    .site-footer-bottom {
        padding-top: 18px;
        text-align: center;
    }
    .site-footer-bottom p {
        margin: 0;
        color: #c91c1c;
        font-size: 18px;
        line-height: 1.7;
        font-weight: 500;
    }

    @media (max-width: 768px) {
        footer { padding: 20px 15px 15px 15px !important; }
        footer div[style*="gap:150px"] { gap: 20px !important; padding-bottom: 15px !important; border-bottom: 1px solid #eee !important; }
        footer div[style*="flex:1 1 420px"] { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1 1 100% !important; }
        footer div[style*="margin-bottom:16px"] { margin-bottom: 5px !important; }
        footer img { max-width: 160px !important; }
        footer p[style*="margin:0 0 0 27px"] { margin: 0 !important; font-size: 13px !important; line-height: 1.4 !important; }
        footer div[style*="flex:1 1 760px"] { gap: 15px !important; flex: 1 1 100% !important; justify-content: center !important; }
        footer div[style*="min-width:260px"] { min-width: 100% !important; margin-left: 0 !important; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px !important; }
        footer h4 { font-size: 15px !important; margin-bottom: 4px !important; letter-spacing: 0 !important; }
        footer p[style*="margin:0 0 12px 0"] { margin-bottom: 4px !important; }
        footer div[style*="gap:50px"] { gap: 8px 20px !important; justify-content: center !important; }
        footer div[style*="min-width:140px"], footer div[style*="min-width:180px"] { min-width: auto !important; gap: 4px !important; align-items: center; }
        footer p, footer a { font-size: 13px !important; line-height: 1.4 !important; }
        footer div[style*="padding-top:18px"] { padding-top: 10px !important; }
        footer p[style*="color:#c91c1c"] { font-size: 12px !important; }
    }
    .flatpickr-time input,
    .flatpickr-time .flatpickr-am-pm {
        font-size: 16px !important;
    }
    .flatpickr-time input,
    .flatpickr-time .flatpickr-am-pm {
        height: 52px !important;
        line-height: 52px !important;
    }
    .booking-field .flatpickr-input[readonly] {
        background: #fff;
        cursor: pointer;
    }

    @media (max-width: 1100px) {
        .hero-navbar { padding: 18px 20px 0 20px; }
        .booking-heading-wrap h2 { font-size: 36px; }
        .booking-main-section { padding: 40px 20px 50px; }
    }

    @media (max-width: 991px) {
        .hero-menu {
            gap: 0;
            margin-top: 12px;
            padding: 16px;
            border-radius: 12px;
            background: rgba(8, 10, 18, 0.85);
            backdrop-filter: blur(8px);
        }
        .nav-login-item {
            margin-left: 0;
            margin-top: 8px;
        }
        .booking-form-card {
            padding: 24px 18px;
        }
    }

    @media (max-width: 767px) {
        .brand-logo { width: 180px; }
        .booking-hero-section { min-height: 280px; }
        .booking-hero-center {
            min-height: 280px;
            padding: 100px 15px 40px;
        }
        .booking-hero-center h1 { font-size: 32px; line-height: 1.2; }
        .booking-heading-wrap h2 { font-size: 26px; margin-bottom: 12px; }

    .dropoff-info-line a {
        color: #c91c1c;
        text-decoration: none;
        font-weight: 600;
    }

    .dropoff-info-line a:hover {
        text-decoration: underline;
    }
        @media (max-width: 576px) {
            .booking-hero-center h1 {
                font-size: 26px;
                line-height: 1.2;
            }

            .booking-hero-center p,
            .booking-hero-center a {
                font-size: 14px;
            }
            .tracking-form > div {
                flex-direction: column !important;
                gap: 10px !important;
            }

            .tracking-input {
                height: 52px !important;
                font-size: 15px !important;
            }

            .tracking-btn {
                width: 100%;
                height: 52px;
                font-size: 15px;
                border-radius: 12px;
            }
            .booking-form-card {
                padding: 18px 14px;
                border-radius: 16px;
            }
            .booking-form-card > div[style*="margin-top: 30px"] {
                padding: 14px !important;
            }
            div[style*="display: flex; justify-content: space-between"] {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 6px;
            }
            div[style*="display: flex; flex-wrap: wrap"] {
                gap: 12px !important;
            }
            div[style*="border-left: 2px solid"] {
                padding-left: 14px !important;
            }

            div[style*="position: absolute; left: -26px"] {
                left: -18px !important;
            }

            /* PACKAGE SUMMARY */
            summary {
                font-size: 13px;
            }
            .custom-dropdown {
                min-width: 100% !important;
                border-radius: 10px;
            }
            footer {
                padding: 40px 16px 20px 16px !important;
            }

            footer div[style*="gap:150px"] {
                gap: 20px !important;
            }

            footer img {
                max-width: 140px !important;
            }

            footer p,
            footer a {
                font-size: 13px !important;
                line-height: 1.5 !important;
            }
        }
</style>

<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
