/* 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 #96c3ae;
        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: #17a2b8 !important;
        color: white !important;
        border: none !important;
    }

    .order-single .cancel-btn {
        background: #dc3545 !important;
        color: white !important;
        border: none !important;
    }

    .order-single .repeat-btn {
        background: #28a745 !important;
        color: white !important;
        border: none !important;
    }

    .order-single .details-btn {
        background: #6c757d !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 #96c3ae !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: #198754 !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;
    }
}