/* ============================================================
   CrystalShipment — Custom Tracking & Receipt Styles
   Responsive fixes applied: mobile-first approach
   ============================================================ */

.track .about-bg {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* ---- Tracking Bar / Journey Timeline ---- */
.tracking-bar-section {
    width: 90%;
    margin: auto;
    background: white;
    border-radius: 5px;
    overflow-x: hidden;
    padding: 40px 20px;
    white-space: nowrap;
}

.tracking-bar-section .box {
    width: 50%;
    margin: auto;
    display: flex;
    padding-bottom: 20px;
    position: relative;
    white-space: normal;
}

.tracking-bar-section .box .progress-container {
    width: 8px;
    flex-shrink: 0;
    margin-right: 20px;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #eee;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tracking-bar-section .box.active .progress-container {
    background: #FF440A;
}

.tracking-bar-section .box.active .progress-container .middle-circle {
    background: #FF440A;
    color: white;
}

.tracking-bar-section .box .progress-container .middle-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    color: grey;
    font-size: 13px;
    position: absolute;
    top: 40%;
    left: -17px;
    flex-shrink: 0;
}

.tracking-bar-section .box:first-child .progress-container {
    border-radius: 5px 5px 0 0;
}

.tracking-bar-section .box:last-child .progress-container {
    border-radius: 0 0 5px 5px;
}

.tracking-bar-section .box .details {
    margin-left: 30px;
    padding-top: 4px;
}

.tracking-bar-section .box .status {
    text-align: left;
    color: rgb(32, 32, 32);
    font-size: 15px;
    font-weight: 600;
    margin-top: 20px;
    padding: 0 10px;
    white-space: normal;
}

.tracking-bar-section .box .note {
    width: 100%;
    text-align: left;
    color: #fa693d;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    padding: 0 10px;
    white-space: normal;
}

.tracking-bar-section .box .date {
    width: 100%;
    text-align: left;
    color: rgb(104, 104, 104);
    font-size: 11px;
    margin-top: 5px;
    padding: 0 10px;
    white-space: normal;
}

/* ---- Barcode ---- */
.bar-code-container {
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.bar-code-container .logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.bar-code-container .logo-container .logo {
    width: 150px;
    height: auto;
}

/* ---- Sender / Receiver ---- */
.sender-and-receiver-container {
    width: 90%;
    position: relative;
    margin: auto;
}

.sender-and-receiver-container h5 {
    border-bottom: 1px solid lightgrey;
    padding-bottom: 15px;
}

/* ---- Shipment Info ---- */
.shipment-information-container {
    width: 90%;
    margin: auto;
    position: relative;
}

.shipment-information-container .section-title {
    position: relative;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: #FF440A;
    border-radius: 5px;
    color: white;
    margin-bottom: 30px;
    margin-top: 20px;
}

.shipment-information-container .image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.shipment-information-container .image-container .image {
    width: 300px;
    height: auto;
    max-width: 100%;
}

/* ---- Google Maps ---- */
.google-maps-container {
    width: 90%;
    background: #eee;
    margin: auto;
    position: relative;
}

/* ---- Print Receipt Container ---- */
.print-receipt-container {
    width: 90%;
    margin: auto;
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 30px;
    flex-direction: column;
    align-items: center;
}

.print-receipt-container .print-receipt-btn {
    padding: 10px 30px;
    background: #FF440A;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ---- Receipt ---- */
.receipt {
    width: 100%;
    max-width: 800px;
    margin: auto;
    border: 1px solid lightgrey;
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 30px 15px;
    position: relative;
    overflow: hidden;
}

.receipt .watermark-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0.1;
    pointer-events: none;
}

.receipt .watermark-container .watermark-image {
    width: 80%;
    height: auto;
    transform: rotate(-50deg);
}

.receipt .top-section {
    width: 100%;
}

.receipt .top-section .logo-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.receipt .top-section .logo-container .logo {
    width: 150px;
    height: auto;
}

.receipt .top-section .invoice-summary-container {
    border: 1px solid lightgrey;
    overflow-x: auto;
}

.receipt .top-section .invoice-summary-container .box {
    width: 100%;
    padding: 10px;
    border-bottom: 1px solid lightgrey;
    font-size: 15px;
    display: flex;
    flex-flow: row nowrap;
    font-weight: 600;
}

.receipt .top-section .invoice-summary-container .box .left {
    position: relative;
    width: 40%;
    word-break: break-word;
}

.receipt .top-section .invoice-summary-container .box .right {
    position: relative;
    width: 60%;
    display: flex;
    justify-content: flex-end;
    word-break: break-word;
}

.receipt table {
    width: 100%;
    margin-top: 40px;
    border-collapse: collapse;
}

.receipt table thead {
    width: 100%;
    background: #eee;
    color: black;
}

.receipt table thead th {
    padding: 10px;
}

.receipt table thead th:first-child {
    border-radius: 5px 0 0 5px;
}

.receipt table thead th:last-child {
    border-radius: 0 5px 5px 0;
}

.receipt table tbody tr td.summary {
    border: 1px solid lightgrey;
}

.receipt table tbody tr td.total-charge {
    background: #eee;
    font-weight: 600;
}

.receipt table tbody tr td {
    padding: 10px;
}

.receipt .go-back-btn {
    padding: 10px 30px;
    background: #FF440A;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    position: relative;
    z-index: 50;
}

/* ============================================================
   RESPONSIVE FIXES — Mobile (≤ 767px)
   ============================================================ */
@media only screen and (max-width: 767px) {

    /* Fix mobile hamburger menu reveal button position */
    .mean-container a.meanmenu-reveal {
        right: 0 !important;
        top: -35px !important;
    }

    /* Logo positioning on mobile */
    .mobile-logo {
        position: relative;
        top: 0;
        left: 0;
    }

    /* Hero slider tracking form - full width stacked */
    .slider-content h2 {
        font-size: 36px !important;
        line-height: 1.2;
    }

    .slider-form form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .slider-form input {
        width: 100%;
    }

    /* Category list stacked */
    .category-list ul {
        flex-direction: column;
    }

    .category-list ul li a {
        width: 100%;
    }

    /* Tracking timeline — full width on mobile */
    .tracking-bar-section {
        width: 100%;
        padding: 30px 15px;
    }

    .tracking-bar-section .box {
        width: 100%;
        margin: auto;
        padding-bottom: 25px;
    }

    .tracking-bar-section .box .status {
        font-size: 14px;
        margin-top: 15px;
    }

    /* Sender/receiver and shipment info — full width */
    .sender-and-receiver-container,
    .shipment-information-container {
        width: 100%;
    }

    /* Shipment info 3-col grid → 1 col on mobile */
    .shipment-information-container .track-card .info-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Receipt — full width, no fixed 800px */
    .print-receipt-container {
        width: 100%;
        padding: 0 10px;
    }

    .receipt {
        width: 100%;
        max-width: 100%;
        padding: 20px 10px;
    }

    .receipt .top-section .invoice-summary-container .box {
        font-size: 13px;
        padding: 8px;
    }

    .receipt table {
        font-size: 13px;
        overflow-x: auto;
        display: block;
    }

    .receipt table thead,
    .receipt table tbody,
    .receipt table tr {
        display: table;
        width: 100%;
    }

    /* Barcode — constrain width */
    #barcode {
        max-width: 100%;
        height: auto;
    }

    svg#barcode {
        max-width: 100% !important;
    }
}

/* ============================================================
   RESPONSIVE FIXES — Small tablet (768px – 991px)
   ============================================================ */
@media only screen and (min-width: 768px) and (max-width: 991px) {

    .tracking-bar-section {
        width: 100%;
    }

    .tracking-bar-section .box {
        width: 70%;
    }

    .sender-and-receiver-container,
    .shipment-information-container {
        width: 100%;
    }

    .print-receipt-container {
        width: 100%;
    }

    .receipt {
        max-width: 100%;
    }
}

/* ============================================================
   RESPONSIVE FIXES — Very small screens (≤ 400px)
   ============================================================ */
@media only screen and (max-width: 400px) {

    .slider-content h2 {
        font-size: 28px !important;
    }

    .shipment-information-container .track-card .info-grid {
        grid-template-columns: 1fr !important;
    }

    .receipt .top-section .invoice-summary-container .box {
        flex-direction: column;
    }

    .receipt .top-section .invoice-summary-container .box .left,
    .receipt .top-section .invoice-summary-container .box .right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    header, footer, .slider-area, .newsletter-area,
    .print-receipt-btn, #preloader, #scrollUp {
        display: none !important;
    }

    .receipt {
        border: none;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    body {
        background: white;
    }
}
