/* Navbar background */
.navbar {
  background-color: green !important;
  padding: 0.25rem 1rem !important;
}

/* Logo inside navbar */
.navbar-brand img {
  margin-left: 10px;
  display: inline-block !important;
  max-width: 100px !important;
  max-height: 100px !important;
}

/* By default, hide the button */
.btn-list-view {
    display: none !important;
}
/* When the screen width is greater than 768px (typically desktop view), show the button */
@media (min-width: 768px) {
    .btn-list-view {
        display: block !important;
    }
}
/* Hide Pay button on webshop */
.page-header-actions-block {
    display: none !important;
}

.cart-indicator {
    display: none !important;
}

.product-code {
    display: none !important;
}

.item-subtitle {
    display: none !important;
}

/* Hide notes section from cart page */
.mt-2.notes {
    display: none !important;
}

/* Number spinner size reduction */
.input-group.number-spinner.mt-1.mb-4 {
    max-width: 150px !important;
    margin: 0.25rem 0 !important;
}

.input-group.number-spinner .form-control {
    height: 32px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.9rem !important;
    max-width: 60px !important;
}

.input-group.number-spinner .btn {
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
    font-size: 0.8rem !important;
}

/* UOM Badge Styles */
.product-price {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 2px !important;
}

.uom-badge {
    font-size: 0.8em !important;
    color: #666 !important;
    font-weight: normal !important;
    margin-left: 2px !important;
}

/* Cart container fixes */
.cart-container {
    width: 100%;
    overflow-x: hidden;
}

.cart-items {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-items table {
    width: 100%;
    table-layout: fixed;
}

.cart-summary {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Fix for item subtotal and grand total overflow */
.text-right.sm-item-subtotal,
.text-left.item-grand-total.totals {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix d-flex overlapping for tablets and mobile */
@media (max-width: 768px) {
    .cart-items .d-flex {
        flex-wrap: wrap !important;
        min-width: 0 !important;
    }
    
    .cart-items .d-flex .item-name {
        min-width: 0 !important;
        flex: 1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* For small mobile only (576px and below) */
@media (max-width: 576px) {
    .cart-items .d-flex {
        flex-direction: column !important;
        gap: 2px !important;
    }
    
    .cart-items .d-flex .item-name {
        white-space: normal !important;
        word-break: break-word !important;
        max-height: 2.4em !important;
        line-height: 1.2 !important;
    }
    
    /* UOM mobile styles */
    .uom-badge {
        font-size: 0.7em !important;
    }
    
    /* Number spinner mobile */
    .input-group.number-spinner.mt-1.mb-4 {
        max-width: 130px !important;
        margin: 0.1rem 0 !important;
    }
    
    .input-group.number-spinner .form-control {
        height: 28px !important;
        padding: 0.2rem 0.4rem !important;
        font-size: 0.85rem !important;
        max-width: 50px !important;
    }
    
    .input-group.number-spinner .btn {
        height: 28px !important;
        width: 28px !important;
        font-size: 0.75rem !important;
    }
    
    /* Cart layout mobile */
    .text-right.sm-item-subtotal,
    .text-left.item-grand-total.totals {
        text-align: left !important;
        padding: 8px 5px;
        font-size: 0.9rem;
    }
    
    /* Ensure proper container constraints */
    .cart-items td:last-child,
    .cart-summary .totals-row {
        max-width: 100vw;
        padding-left: 5px;
        padding-right: 5px;
    }
    
    /* Specific fix for subtotal column */
    .sm-item-subtotal {
        min-width: 80px;
        max-width: 100px;
        text-align: right !important;
    }
    
    /* Specific fix for grand total */
    .item-grand-total.totals {
        font-size: 1.1rem;
        font-weight: bold;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Cart table mobile optimization */
    .cart-items table {
        table-layout: auto;
        font-size: 0.85rem;
    }
    
    .cart-items td,
    .cart-items th {
        padding: 6px 4px;
    }
    
    /* Ensure cart summary doesn't overflow */
    .cart-summary {
        margin-top: 15px;
        padding: 10px;
    }
    
    /* Buttons */
    .btn-checkout,
    .btn-continue-shopping {
        width: 100%;
        margin: 5px 0;
    }
}

/* For very small mobile (360px and below) */
@media (max-width: 360px) {
    .cart-items .d-flex .item-name {
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        max-height: 1.2em !important;
    }
}

/* Very small screens (iPhone 5/SE etc) */
@media (max-width: 320px) {
    .text-right.sm-item-subtotal,
    .text-left.item-grand-total.totals {
        font-size: 0.8rem;
        padding: 5px 3px;
    }
    
    .sm-item-subtotal {
        min-width: 70px;
        max-width: 80px;
    }
    
    .item-grand-total.totals {
        font-size: 1rem;
    }
    
    .cart-items table {
        font-size: 0.8rem;
    }
    
    .cart-items td,
    .cart-items th {
        padding: 4px 2px;
    }
}

/* Tablet screens (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .text-right.sm-item-subtotal,
    .text-left.item-grand-total.totals {
        padding: 10px 8px;
        font-size: 0.95rem;
    }
    
    .sm-item-subtotal {
        min-width: 90px;
        max-width: 120px;
    }
    
    .cart-items table {
        font-size: 0.9rem;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .cart-items table {
        table-layout: fixed;
    }
    
    .text-right.sm-item-subtotal,
    .text-left.item-grand-total.totals {
        padding: 12px 10px;
        font-size: 1rem;
    }
}

/* Ensure table cells don't overflow */
.cart-items td {
    max-width: 1px; /* Forces text wrapping */
}

/* Force text wrapping in specific columns */
.cart-items td:nth-last-child(2), /* Second last column (usually subtotal) */
.cart-items td:last-child { /* Last column */
    word-break: break-word;
    white-space: normal !important;
}

/* Fix for cart summary totals */
.cart-summary .totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.cart-summary .totals-row .text-left {
    flex: 1;
    min-width: 120px;
}

.cart-summary .totals-row .text-right {
    flex-shrink: 0;
}

/* Alternative: Stack layout for very small screens */
@media (max-width: 360px) {
    .cart-summary .totals-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cart-summary .totals-row .text-right {
        align-self: flex-end;
    }
}

/* Emergency overflow prevention for all screens */
.cart-items {
    overflow-x: auto;
}

.cart-items table {
    min-width: 100%;
    border-collapse: collapse;
}

/* Ensure buttons don't break layout */
.btn-checkout,
.btn-continue-shopping {
    white-space: nowrap;
    min-width: fit-content;
}
/*
 * --- Plain Text UOM Styling ---
 * This CSS removes all badge designs and makes the UOM text
 * match the same font size and color as the price.
*/

/* This ensures the price and UOM are properly aligned on the same line. */
.product-price {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 4px !important; /* A small space between price and UOM */
}

/*
 * This resets the UOM to look like plain text.
 * It removes the background color and padding from previous versions.
 * "inherit" tells it to use the same styles (like color and font-weight) as its parent.
*/
.uom-badge {
    background-color: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    padding: 0 !important;
    border-radius: 0 !important;
    line-height: inherit !important;
}


