html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
    .img-cart-empty{
        width: 50%;
}
    .fs-lg-custom{
        font-size: 1rem;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
    background-color: #F8F9FA;
}

.border-right-custom {
    border-right: 1px solid !important;
    border-color: inherit !important;
}

.multiple-input .form-control:focus, .multiple-input .form-select:focus {
    box-shadow: none !important;
}

.list-style-none{
    list-style: none;
}
.fs-small{
    font-size:small;
}

.filter-container > * {
    margin-left: 1em;
    margin-right: 1em;
}
tr > td{
    text-align: center;
    vertical-align: middle;
}
.swal2-close:focus {
    outline: none;
    box-shadow: none;
}

.cursor-pointer{
    cursor: pointer;
}



.anim-appear {
    animation: 0.3s ease-out 0s 1 appear;
}

input[type="checkbox"][readonly] {
    pointer-events: none;
}

@keyframes appear {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
.pb-custom {
    padding-bottom: 6rem !important;
}
.w-min-content {
    width: min-content;
}

.form-check-input {
    clear: left;
}

.form-switch.form-switch-sm {
    margin-bottom: 0.5rem; /* JUST FOR STYLING PURPOSE */
}

    .form-switch.form-switch-sm .form-check-input {
        height: 1rem;
        width: calc(1rem + 0.75rem);
        border-radius: 2rem;
    }

.form-switch.form-switch-md {
    margin-bottom: 1rem; /* JUST FOR STYLING PURPOSE */
}

    .form-switch.form-switch-md .form-check-input {
        height: 1.5rem;
        width: calc(2rem + 0.75rem);
        border-radius: 3rem;
    }

.form-switch.form-switch-lg {
    margin-bottom: 1.5rem; /* JUST FOR STYLING PURPOSE */
}

    .form-switch.form-switch-lg .form-check-input {
        height: 2rem;
        width: calc(3rem + 0.75rem);
        border-radius: 4rem;
    }

.form-switch.form-switch-xl {
    margin-bottom: 2rem; /* JUST FOR STYLING PURPOSE */
}

    .form-switch.form-switch-xl .form-check-input {
        height: 2.5rem;
        width: calc(4rem + 0.75rem);
        border-radius: 5rem;
    }

.row-d-mobile{
    display:none;
}
@media (max-width: 768px) {
    tr > td {
        display:none;
    }
    tr {
        background: white;
    }
    .table-bordered > :not(caption) > * {
        border: none !important;
    }
    .row-d-mobile {
        padding: 0px !important;
        display: list-item;
    }
    .filter-toggle{
        width: 100%;
    }

    .navbar-nav {
        display: contents !important;
    }

        .navbar-nav > li {
            display: inline-block !important;
        }

    .table-h-fixed{
        max-height: 100% !important;
    }
}

.nav-item {
    border-bottom: 1px solid transparent;
}
.nav-item.active {
    border-bottom: 1px solid black;
}
td {
    text-wrap: nowrap;
}
/*td > input {
    min-width: max-content;
}*/

.table-h-fixed {
    max-height: 62vh;
}
.table-h-fixed thead {
    position: sticky;
    top: 0;
}


::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    /*box-shadow: inset 0 0 5px rgba(0,0,0,0.3);*/
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 10px;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: #212529;
    border-radius: 10px;
    cursor:pointer;
}

.row-mobile{
    display:flex;
    align-items:center;
}
.row-mobile > span:first-child {
    margin-right: 0.5em;
}

/* Mobile Cards */
.mobile-card {
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

.mobile-card .status-header {
    padding-bottom: 8px;
    border-bottom: 1px solid #f8f9fa;
    margin-bottom: 8px;
}

.mobile-card .info-row {
    padding: 4px 0;
    font-size: 0.9rem;
}

.mobile-card .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.mobile-card .status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-card .action-row {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f8f9fa;
}

.mobile-card .total-amount {
    font-size: 1.1rem;
    color: #198754;
}

/* Order Status Colors - Mobile View (default) */
.order-status-cancelled {
    border-left: 4px solid #dc3545;
}
.order-status-cancelled .status-badge {
    background-color: #dc3545;
    color: white;
    font-weight: 600;
}

.order-status-placed {
    border-left: 4px solid #0d6efd;
}
.order-status-placed .status-badge {
    background-color: #0d6efd;
    color: white;
    font-weight: 600;
}

.order-status-finalised {
    border-left: 4px solid #fd7e14;
}
.order-status-finalised .status-badge {
    background-color: #fd7e14;
    color: white;
    font-weight: 600;
}

.order-status-finalisedmodified {
    border-left: 4px solid #e91e63;
}
.order-status-finalisedmodified .status-badge {
    background-color: #e91e63;
    color: white;
    font-weight: 600;
}

.order-status-receivable {
    border-left: 4px solid #ffc107;
}
.order-status-receivable .status-badge {
    background-color: #ffc107;
    color: #212529;
    font-weight: 600;
}

.order-status-fulfilled {
    border-left: 4px solid #198754;
}
.order-status-fulfilled .status-badge {
    background-color: #198754;
    color: white;
    font-weight: 600;
}

/* Delivery Note Status Colors - Mobile View (default) */
.deliverynote-status-editable {
    border-left: 4px solid #ffc107;
}
.deliverynote-status-editable .status-badge {
    background-color: #ffc107;
    color: #212529;
    font-weight: 600;
}

.deliverynote-status-finalized {
    border-left: 4px solid #198754;
}
.deliverynote-status-finalized .status-badge {
    background-color: #198754;
    color: white;
    font-weight: 600;
}

/* Desktop table styling - matches Bootstrap LG breakpoint */
@media (min-width: 992px) {
    /* Remove mobile borders and add subtle backgrounds for table rows */
    .order-status-cancelled,
    .order-status-placed,
    .order-status-finalised,
    .order-status-receivable,
    .order-status-fulfilled,
    .deliverynote-status-editable,
    .deliverynote-status-finalized {
        border-left: none;
    }
    
    /* Order Status Desktop Colors */
    .order-status-cancelled {
        background-color: rgba(220, 53, 69, 0.08);
    }
    
    .order-status-placed {
        background-color: rgba(13, 110, 253, 0.08);
    }
    
    .order-status-finalised {
        background-color: rgba(253, 126, 20, 0.08);
    }
    
    .order-status-finalisedmodified {
        background-color: rgba(233, 30, 99, 0.08);
    }
    
    .order-status-receivable {
        background-color: rgba(255, 193, 7, 0.08);
    }
    
    .order-status-fulfilled {
        background-color: rgba(25, 135, 84, 0.08);
    }
    
    /* Delivery Note Status Desktop Colors */
    .deliverynote-status-editable {
        background-color: rgba(255, 193, 7, 0.08);
    }
    
    .deliverynote-status-finalized {
        background-color: rgba(25, 135, 84, 0.08);
    }
    
    /* Desktop status badges remain colored but slightly smaller */
    .order-status-cancelled .status-badge,
    .order-status-placed .status-badge,
    .order-status-finalised .status-badge,
    .order-status-finalisedmodified .status-badge,
    .order-status-receivable .status-badge,
    .order-status-fulfilled .status-badge,
    .deliverynote-status-editable .status-badge,
    .deliverynote-status-finalized .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
    }
}

/* Order Item Status Colors - Mobile View */
.order-item-completed {
    border-left: 4px solid #198754;
}
.order-item-completed .status-badge {
    background-color: #198754;
    color: white;
    font-weight: 600;
}

.order-item-pending {
    border-left: 4px solid #ffc107;
}
.order-item-pending .status-badge {
    background-color: #ffc107;
    color: #212529;
    font-weight: 600;
}

/* Delivery Note Item Completion Status */


/* Mobile card specific styling for completed items */
.mobile-card.delivery-item-completed {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border-left: 6px solid #198754 !important;
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.2) !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Desktop table row for completed items */
@media (min-width: 992px) {
    .delivery-item-completed {
        background-color: rgba(25, 135, 84, 0.12) !important;
/*        border-left: 5px solid #198754 !important;
*/        box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.2) !important;
    }
    
}
.icon-fit {
    object-fit:contain;
    width: 2.5rem;
}

.scroll-margin-top {
    scroll-margin-top: 7em;
}




.lds-spinner,
.lds-spinner div,
.lds-spinner div:after {
    box-sizing: border-box;
}

.lds-spinner {
    color: currentColor;
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

    .lds-spinner div {
        transform-origin: 40px 40px;
        animation: lds-spinner 1.2s linear infinite;
    }

        .lds-spinner div:after {
            content: " ";
            display: block;
            position: absolute;
            top: 3.2px;
            left: 36.8px;
            width: 6.4px;
            height: 17.6px;
            border-radius: 20%;
            background: currentColor;
        }

        .lds-spinner div:nth-child(1) {
            transform: rotate(0deg);
            animation-delay: -1.1s;
        }

        .lds-spinner div:nth-child(2) {
            transform: rotate(30deg);
            animation-delay: -1s;
        }

        .lds-spinner div:nth-child(3) {
            transform: rotate(60deg);
            animation-delay: -0.9s;
        }

        .lds-spinner div:nth-child(4) {
            transform: rotate(90deg);
            animation-delay: -0.8s;
        }

        .lds-spinner div:nth-child(5) {
            transform: rotate(120deg);
            animation-delay: -0.7s;
        }

        .lds-spinner div:nth-child(6) {
            transform: rotate(150deg);
            animation-delay: -0.6s;
        }

        .lds-spinner div:nth-child(7) {
            transform: rotate(180deg);
            animation-delay: -0.5s;
        }

        .lds-spinner div:nth-child(8) {
            transform: rotate(210deg);
            animation-delay: -0.4s;
        }

        .lds-spinner div:nth-child(9) {
            transform: rotate(240deg);
            animation-delay: -0.3s;
        }

        .lds-spinner div:nth-child(10) {
            transform: rotate(270deg);
            animation-delay: -0.2s;
        }

        .lds-spinner div:nth-child(11) {
            transform: rotate(300deg);
            animation-delay: -0.1s;
        }

        .lds-spinner div:nth-child(12) {
            transform: rotate(330deg);
            animation-delay: 0s;
        }

@keyframes lds-spinner {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


.btn:active, .btn:focus{
    box-shadow: none !important;
}
.page-item.active .page-link {
    background-color: var(--bs-dark);
    border-color: var(--bs-dark);
}
.page-link, .page-link:hover {
    color: var(--bs-dark);
}

td:has(input.w-fixed) {
    max-width: 9rem !important;
    min-width: 6rem !important;
}

.motion-item-input-group:not(:first-child), .motion-item-input-group:not(:last-child) {
    margin-top: .5rem;
    margin-bottom: .5rem;
}
.motion-items-contaniner {
    overflow-y: auto;
    max-height: 10rem;
}

select[readonly] {
   pointer-events: none;
}

/* Fixed Bottom Mobile Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    padding: 8px 0;
    display: none;
}

.mobile-bottom-nav .nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    padding: 0 16px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-bottom-nav .nav-item:hover,
.mobile-bottom-nav .nav-item:focus {
    color: #0d6efd;
    text-decoration: none;
}

.mobile-bottom-nav .nav-item.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-bottom-nav .nav-item .badge {
    position: absolute;
    top: -2px;
    right: 0;
    font-size: 0.65rem;
    padding: 2px 5px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
}

/* Show mobile bottom nav only on mobile screens */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
}

/* Fixed Bottom Actions for Edit Delivery Note */
.edit-delivery-note-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    padding: 12px 16px;
    display: none;
    margin-left: 0;
}

/* Fixed Bottom Actions for Delivery Note Details */
.delivery-note-details-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    padding: 12px 16px;
    display: none;
    margin-left: 0;
}

/* Fixed Bottom Actions for Order Details */
.order-details-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1050;
    padding: 12px 16px;
    display: none;
    margin-left: 0;
}

@media (max-width: 991px) and (min-width: 768px) {
    .edit-delivery-note-actions,
    .delivery-note-details-actions,
    .order-details-actions {
        display: block;
        /* Tablet: col-md-3 = 25% width */
        left: 25%;
        right: 0;
        margin-left: 0;
        width: 75%;
    }
}

@media (max-width: 767px) {
    .edit-delivery-note-actions,
    .delivery-note-details-actions,
    .order-details-actions {
        display: block;
        /* Mobile: col-1 = 8.33% width */
        left: 8.33%;
        right: 0;
        margin-left: 0;
        width: 91.67%;
    }
    
    /* Add extra bottom padding when fixed actions are present */
    .edit-delivery-note-container,
    .delivery-note-details-container,
    .order-details-container {
        padding-bottom: 120px;
    }
    
    /* Mobile cards in delivery note items - more compact - ONLY for EditDeliveryNote page */
    .edit-delivery-note-container .mobile-card {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    
    .edit-delivery-note-container .mobile-card .info-row {
        padding: 2px 0;
        font-size: 0.85rem;
    }
    
    .edit-delivery-note-container .mobile-card .form-control-sm {
        font-size: 0.75rem;
        padding: 0.125rem 0.25rem;
        min-width: 0;
    }
    
    .edit-delivery-note-container .mobile-card .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .edit-delivery-note-container .mobile-card .info-item {
        gap: 4px;
        min-width: 0;
        flex-shrink: 1;
    }
    
    .edit-delivery-note-container .mobile-card .info-item i {
        font-size: 0.9rem;
    }
    
    /* Prevent horizontal overflow in mobile cards - ONLY for EditDeliveryNote page */
    .edit-delivery-note-container .mobile-card * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .edit-delivery-note-container .mobile-card .d-flex {
        min-width: 0;
    }
    
    .edit-delivery-note-container .mobile-card .d-flex.gap-2 {
        gap: 0.5rem !important;
    }
    
    .edit-delivery-note-container .mobile-card .flex-fill {
        min-width: 0;
        flex-shrink: 1;
    }
    
    
    /* Admin sidebar adjustments for mobile */
    .bg-dark .px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* DeliveryNotes list mobile card fixes - prevent horizontal overflow */
@media (max-width: 991px) {
    /* Only for pages that load DeliveryNotesList component */
    .load-async[data-action="DeliveryNotesList"] .mobile-card .info-item {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    
    .load-async[data-action="DeliveryNotesList"] .mobile-card .info-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .load-async[data-action="DeliveryNotesList"] .mobile-card .d-flex {
        min-width: 0;
    }
    
    .load-async[data-action="DeliveryNotesList"] .mobile-card .fw-semibold {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* OrderDetails mobile card fixes - prevent horizontal overflow */
@media (max-width: 991px) {
    /* Only for OrderDetails pages */
    .container-fluid:has(h4:contains("OrderDetails")) .mobile-card .info-item,
    div[data-title*="OrderDetails"] .mobile-card .info-item {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    
    .container-fluid:has(h4:contains("OrderDetails")) .mobile-card .info-item span,
    div[data-title*="OrderDetails"] .mobile-card .info-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }
    
    .container-fluid:has(h4:contains("OrderDetails")) .mobile-card .fw-semibold,
    div[data-title*="OrderDetails"] .mobile-card .fw-semibold {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 140px;
    }
    
    .container-fluid:has(h4:contains("OrderDetails")) .mobile-card .d-flex,
    div[data-title*="OrderDetails"] .mobile-card .d-flex {
        min-width: 0;
    }
}

/* OrderItemViewModel mobile card fixes - prevent horizontal overflow */
@media (max-width: 991px) {
    /* Order items in OrderDetails pages */
    .order-items-container .mobile-card .info-item,
    div[id*="order-items"] .mobile-card .info-item {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
    }
    
    .order-items-container .mobile-card .info-item span,
    div[id*="order-items"] .mobile-card .info-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .order-items-container .mobile-card .fw-semibold,
    div[id*="order-items"] .mobile-card .fw-semibold {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .order-items-container .mobile-card .fw-bold,
    div[id*="order-items"] .mobile-card .fw-bold {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .order-items-container .mobile-card .d-flex,
    div[id*="order-items"] .mobile-card .d-flex {
        min-width: 0;
    }
}


.bg-danger-light {
    background-color: rgba(var(--bs-danger-rgb), .4) !important;
}

.btn-toggle-motion-status-visiblity.closed {
    transform: rotate(180deg);
}

@media (max-width: 987px) {
    .quantity{
        min-width: auto;
    }
}
.table-sticky{
    position: sticky;
}
.table-sticky-cell{
    position: sticky;
    background-color: #f8f9fa !important;
}