﻿
/* < 1200px = mobile header */
@media screen and (max-width: 1199px) {
    footer#page-header-desktop { display: none !important; }
    footer#page-footer-desktop { display: none !important; }

    #OrderDetailTable {
        width: 1280px;
    }
    
    #LineItemTableContainer .overflow-x-scroll {
        width: 95vw;
    }
}

/* < 992px Mobile page breakdown begins */
@media screen and (max-width: 991px) {
    .align-items-center {
        -webkit-box-align: unset !important;
        -ms-flex-align: unset !important;
        align-items: unset !important;
    }
    
    /* Start Order List page */
    .item_swift_customercenter .item_swift_customercenterapp > div {
        width: auto;
    }

    .item_swift_customercenter .item_swift_customercenterapp header {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 92vw !important;
    }

    .portal-order-list-container {
        overflow-x: auto;
    }
    /*.portal-order-list-container table.d-none {
        display: unset !important;
    }*/
    /* End Order List page */

    /* Start Order Details page */
    
    .portal-order-line-items-tbl {
        width: 150%;
    }
    
    /*.item_swift_customercenterapp table#OrderDetailTable.d-none {
        display: unset !important;
    }*/

    .responsive > thead th {
        display: block;
    }
    .responsive > tbody td,
    .responsive > tbody th {
        display: block;
    }
    .responsive > tbody > tr:nth-child(even) td,
    .responsive > tbody > tr:nth-child(even) th {
        background-color: #eee;
    }
    [row-header] {
        position: relative;
        /* width: 50%;*/
        vertical-align: middle;
    }
    [row-header]:before {
        content: attr(row-header);
        display: inline-block;
        vertical-align: middle;
        text-align: left;
        width: 50%;
        padding-right: 30px;
        white-space: nowrap;
        overflow: hidden;
    }

    #shipping-items .table-clean {
        width: 100%;
    }
    #shipping-items .d-table-row {
        display: grid !important;
        grid-template-columns: 1fr;
        row-gap: 1rem;
    }
    #shipping-items .d-table-row .d-table-cell {
        padding-left: 0 !important;
    }
    #shipping-items .d-table-row .d-table-cell table {
        width: 100%;
    }

    .portal-order-detail-tabs.container {
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
    }

    /* End Order Details page */
}
@media screen and (min-width: 576px) {
    .container, .container-sm {
        max-width: unset !important;
    }
    .portal-order-line-items-tbl {
        width: 100%;
    }
}
@media screen and (max-width: 576px) {
    .portal-order-line-items-tbl {
        width: 175%;
    }
}

@media only screen and (max-width: 478px) {
    .portal-order-detail-tabs li.nav-item {
        padding-right: 0.2rem;
    }
    .portal-order-line-items-tbl {
        width: 225%;
    }
}

/* Mobile Table Stacking (Card View) */
@media only screen and (max-width: 991px) {
    
    /* Force table to not act like a table anymore */
    .table-mobile-stack, 
    .table-mobile-stack tbody, 
    .table-mobile-stack tr, 
    .table-mobile-stack td { 
        display: block; 
        width: 100%;
    }
    
    /* Hide the table header (but keep it accessible for screen readers) */
    .table-mobile-stack thead { 
        display: none; 
    }
    
    /* Style each "Row" as a Card */
    .table-mobile-stack tr { 
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        background-color: #fff;
    }
    
    /* Style the cells to look like list items */
    .table-mobile-stack td { 
        text-align: right; /* Value on the right */
        padding-left: 50% !important; /* Make space for the label */
        position: relative;
        border-bottom: 1px solid #eee;
        white-space: normal !important; /* Override text-nowrap so text wraps */
        min-height: 40px; /* Ensure thin rows are clickable/visible */
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    
    /* Remove border from the last item in the card */
    .table-mobile-stack td:last-child {
        border-bottom: 0;
    }
    
    /* Inject the Label using the data-title attribute */
    .table-mobile-stack td::before { 
        content: attr(data-title);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: bold;
        color: #6c757d; /* Muted text color for labels */
    }

    /* Fix stripe color interfering with card background */
    .table-striped > tbody > tr:nth-of-type(odd) > * {
        --bs-table-accent-bg: transparent;
    }
}