/* Order display fixes */
.order-single {
    min-width: 0; /* Allow flex items to shrink below content size */
}

.order-single .d-flex {
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
}

/* Ensure action buttons stay contained */
.order-single .d-flex > div {
    min-width: 0; /* Allow flex items to shrink */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1200px) {
    .order-single .text-center {
        min-width: auto;
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .order-single .d-flex[style*="gap: 1rem"] {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .order-single .d-flex[style*="gap: 1rem"] > div {
        min-width: auto;
        width: 100%;
        text-align: center;
    }
}

/* Mobile-specific responsive fixes (matches style.css) */
@media (max-width: 575.98px) {
    /* Mobile order layout */
    .order-single {
        display: flex !important;
        flex-direction: column !important;
        padding: 15px !important;
        gap: 15px !important;
    }

    /* Action buttons mobile layout - override previous styles */
    .order-single .d-flex[style*="min-width: 180px"] {
        min-width: auto !important;
        width: 100% !important;
        justify-content: space-around !important;
        gap: 8px !important;
        margin-top: 15px;
        padding: 10px 0;
        border-top: 1px dashed var(--primary-200);
        flex-direction: row !important; /* Override column direction */
    }

    .order-single .action-btn {
        min-width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    /* Better action button colors and styles for mobile */
    .order-single .refresh-status-btn {
        background: var(--info) !important;
        color: white !important;
        border: none !important;
    }

    .order-single .cancel-btn {
        background: var(--action-destructive) !important;
        color: white !important;
        border: none !important;
    }

    .order-single .repeat-btn {
        background: var(--action-brand) !important;
        color: white !important;
        border: none !important;
    }

    .order-single .details-btn {
        background: var(--neutral-600) !important;
        color: white !important;
        border: none !important;
        text-decoration: none !important;
    }

    /* Order content mobile layout */
    .order-single .text-center {
        text-align: left !important;
        margin-bottom: 10px;
    }

    /* Remove fixed widths on mobile */
    .order-single [style*="min-width"] {
        min-width: auto !important;
        width: 100% !important;
    }

    /* Package form mobile fixes - ensure these override style.css */
    .package-container {
        padding: 15px 10px !important;
        border-bottom: 1px dashed var(--primary-200) !important;
        margin-bottom: 20px !important;
        background: rgba(255, 255, 255, 0.3) !important;
        border-radius: 8px !important;
    }

    .package-container .form-group {
        margin-bottom: 20px !important;
    }

    .package-container .form-control {
        font-size: 16px !important;
        padding: 12px 15px !important;
        border-radius: 6px !important;
        min-height: 48px !important;
        border: 1px solid #ddd !important;
    }

    .package-container .input-group-text {
        font-size: 14px !important;
        padding: 12px 12px !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        background: #f8f9fa !important;
        border: 1px solid #ddd !important;
        border-left: none !important;
    }

    .package-container .form-control:focus {
        border-color: var(--primary-800) !important;
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
    }

    /* Service cards/offers mobile fixes */
    .offer-footer {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    .offer-footer .price-info {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 10px !important;
        margin-right: 0 !important;
    }

    .offer-footer .select-btn {
        width: 100% !important;
        font-size: 14px !important;
        padding: 12px 16px !important;
    }

    /* Tracking status text wrapping fix */
    .tracking-status {
        align-items: flex-start !important;
        line-height: 1.4 !important;
    }

    .tracking-text {
        word-break: break-word !important;
        hyphens: auto !important;
        line-height: 1.3 !important;
        margin-top: 1px !important;
    }

    /* Service name responsiveness */
    .offer h6 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
    }
}

/* Dropdown action items: render as neutral rows, not legacy gradient pills.
   The cancel/repeat/details/refresh classes stay on the markup as JS + semantic
   hooks (refresh-status-btn and cargobus-cancel are queried by orders JS),
   but inside the kebab dropdown they must not paint backgrounds.
   .order-single ancestor raises specificity above the primary-action master rule
   (which catches <button type="submit"> dropdown items). */
.order-single .dropdown-menu .dropdown-item.cancel-btn,
.order-single .dropdown-menu .dropdown-item.cargobus-cancel,
.order-single .dropdown-menu .dropdown-item.repeat-btn,
.order-single .dropdown-menu .dropdown-item.details-btn,
.order-single .dropdown-menu .dropdown-item.refresh-status-btn {
    background-image: none !important;
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--neutral-800) !important;
    box-shadow: none !important;
    font-weight: 500 !important;
}

.order-single .dropdown-menu .dropdown-item.cancel-btn,
.order-single .dropdown-menu .dropdown-item.cargobus-cancel {
    color: var(--action-destructive) !important;
}

.order-single .dropdown-menu .dropdown-item.cancel-btn:hover,
.order-single .dropdown-menu .dropdown-item.cargobus-cancel:hover,
.order-single .dropdown-menu .dropdown-item.repeat-btn:hover,
.order-single .dropdown-menu .dropdown-item.details-btn:hover,
.order-single .dropdown-menu .dropdown-item.refresh-status-btn:hover {
    background-image: none !important;
    background-color: var(--primary-50) !important;
    color: var(--primary-900) !important;
    transform: none !important;
    box-shadow: none !important;
}

.order-single .dropdown-menu .dropdown-item.cancel-btn:hover,
.order-single .dropdown-menu .dropdown-item.cargobus-cancel:hover {
    color: var(--action-destructive-hover) !important;
}

/* Carrier logo monogram fallback — used when public/logos/{code}.png is missing.
   Branded tile instead of a broken grey box. Colors from green-theme :root tokens. */
.carrier-logo {
    background: #fff;
}
.carrier-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 45px;
    border-radius: 6px;
    border: 1px solid var(--primary-200, #a5d6a5);
    background: var(--primary-50, #e8f5e8);
    color: var(--primary-800, #2e7d32);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    user-select: none;
}

/* ------------------------------------------------------------------ */
/* Orders: shared column header (xl+)                                  */
/* One header row for the whole list; each card hides its per-column   */
/* labels at this breakpoint (d-xl-none in the blade). It mirrors the  */
/* .order-single flex skeleton — 276px identity block (70px logo +     */
/* 1rem gap + 190px service-info), the equal .order-data-cols, and the */
/* 40px actions toggle — so columns line up by construction. Shown     */
/* only at xl (≥1200px): below that the card's inner 880px min-width   */
/* scrolls on its own and a shared row cannot stay aligned.            */
/* ------------------------------------------------------------------ */
.orders-table-head {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Status pills: keep the FA icon on the text baseline inside the badge */
.order-single .badge > i {
    vertical-align: -0.075em;
}