/* =================================================================
   CART PAGE STYLES
   ================================================================= */

.cart-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #6fb881 0%, #8fc89b 50%, #a8d8b5 100%);
    position: relative;
}

.cart-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

/* Cart page specific top-bar (NOT the professional topbar) */
.cart-page .top-bar,
.checkout-page .top-bar {
    position: absolute;
    top: 15px;
    left: 20px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 8px;
    color: #28a745;
    font-size: 13px;
    font-weight: 500;
    z-index: 10;
    display: block;
}

.container-fluid {
    position: relative;
    z-index: 1;
    padding: 80px 30px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.row {
    display: flex;
    gap: 25px;
}

.cart-section, .checkout-section {
    background: rgba(242, 244, 247, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 35px;
    height: fit-content;
}

.cart-section {
    flex: 1;
}

.checkout-section {
    width: 380px;
    flex-shrink: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

.cart-count {
    font-size: 14px;
    color: #9ca3af;
    margin-left: 15px;
}

.cart-icon {
    font-size: 18px;
    color: #9ca3af;
    margin-right: 8px;
}

.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item.list-view {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    min-height: 80px;
    position: relative;
    transition: all 0.2s ease;
}

.cart-item.list-view:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.cart-item.list-view .item-image {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #e9ecef;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.cart-item.list-view .item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.cart-item.list-view .item-company {
    font-size: 11px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.cart-item.list-view .item-name {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 2px;
}

.item-meta span {
    font-size: 12px;
    color: #6b7280;
}

.cart-item.list-view .item-category {
    background: #e5e7eb;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    color: #4b5563;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    width: fit-content;
    grid-column: 3;
    display: none;
}

.cart-item.list-view .item-unit {
    display: none;
}

.cart-item.list-view .item-size {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
    background: #e9ecef;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.cart-item.list-view .quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.qty-value {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    min-width: 25px;
    text-align: center;
}

.cart-item.list-view .item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 100px;
    flex-shrink: 0;
}

.cart-item.list-view .price-current {
    font-size: 18px;
    font-weight: 800;
    color: #28a745;
    letter-spacing: -0.5px;
}

.cart-item.list-view .price-original {
    font-size: 12px;
    color: #6c757d;
    text-decoration: line-through;
    font-weight: 600;
}

.cart-item.list-view .btn-remove-x {
    width: 32px;
    height: 32px;
    border: 2px solid #e9ecef;
    background: white;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 8px;
}

.cart-item.list-view .btn-remove-x:hover {
    color: white;
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.15);
}

.cart-item.list-view .item-barcode {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #495057;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
    min-height: 42px;
    justify-content: center;
}

.cart-item.list-view .item-barcode i {
    font-size: 15px;
    color: #6c757d;
}

.cart-item.list-view .item-barcode img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-cancel, .btn-help {
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-cancel i, .btn-help i {
    font-size: 24px;
    color: #6b7280;
    margin-bottom: 4px;
}

.btn-cancel span, .btn-help span {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.btn-cancel:hover, .btn-help:hover {
    border-color: #3ebc5e;
    transform: scale(1.05);
}

.checkout-header {
    text-align: center;
    margin-bottom: 25px;
}

.checkout-title {
    font-size: 22px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

.order-summary {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #6b7280;
}

.summary-row.total {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    margin-top: 12px;
}

.payment-device {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-device:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.device-visual {
    background: #1f2937;
    width: 100px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.tap-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.tap-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 25px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.payment-icon {
    width: 50px;
    height: 32px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icon img {
    max-width: 85%;
    max-height: 85%;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-cart h5 {
    color: #6b7280;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #9ca3af;
    margin-bottom: 25px;
}

.empty-cart .btn {
    background: linear-gradient(135deg, #3ebc5e, #34a350);
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(62, 188, 94, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.empty-cart .btn:hover {
    background: linear-gradient(135deg, #34a350, #2d8f45);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(62, 188, 94, 0.4);
}

.empty-cart .btn i {
    font-size: 20px;
    color: white;
    margin: 0;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 5px;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: #f3f4f6;
}

.view-btn.active {
    background: #3ebc5e;
    color: white;
}

/* Barcode Search & Scanner Section */
.barcode-search-section {
    margin-bottom: 25px;
}

.search-scanner-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.barcode-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s;
}

.barcode-search:focus-within {
    border-color: #3ebc5e;
    box-shadow: 0 0 0 3px rgba(62, 188, 94, 0.1);
}

.barcode-search > i {
    font-size: 20px;
    color: #6b7280;
}

.btn-search {
    background: #3ebc5e;
}

.btn-search:hover {
    background: #34a350;
}

.btn-search i {
    color: white;
    font-size: 18px;
}

.barcode-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #111827;
    background: transparent;
}

.barcode-input::placeholder {
    color: #9ca3af;
}

.barcode-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Barcode notification styles */
.barcode-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.btn-search {
    width: 38px;
    height: 38px;
    background: #3ebc5e;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-search:hover {
    background: #34a350;
}

.scanner-actions {
    display: flex;
    gap: 10px;
}

.btn-scanner,
.btn-download-csv {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-scanner:hover,
.btn-download-csv:hover {
    border-color: #3ebc5e;
    color: #3ebc5e;
}

.btn-scanner i,
.btn-download-csv i {
    font-size: 18px;
}

/* Scanner Container */
.scanner-container {
    position: relative;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scanner-video {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.btn-close-scanner {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.btn-close-scanner:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 150px;
    border: 2px solid #3ebc5e;
    border-radius: 8px;
    pointer-events: none;
}

/* =================================================================
   PROFESSIONAL GRID VIEW STYLES
   ================================================================= */

.cart-items-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Ensure empty cart stays centered in grid view */
.cart-items-container.grid-view .empty-cart {
    grid-column: 1 / -1;
    text-align: center;
}

.cart-item.grid-view {
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    min-height: auto;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cart-item.grid-view:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #28a745;
}

/* Remove Button - Top Right */
.cart-item.grid-view .btn-remove-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.cart-item.grid-view .btn-remove-x:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* Barcode Section - Before Quantity Control */
.cart-item.grid-view .item-barcode {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    order: 2;
    min-height: 48px;
    position: relative;
    z-index: 1;
}

.cart-item.grid-view .item-barcode img {
    height: 28px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.cart-item.grid-view .item-barcode span {
    display: none;
}

.cart-item.grid-view .item-barcode i {
    display: none;
}

/* Category Badge - Top Left on Card */
.cart-item.grid-view .item-category {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 8px;
    padding: 4px 10px;
    border-radius: 10px;
    background: #28a745;
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    z-index: 15;
    display: block;
}

/* Image Section */
.cart-item.grid-view .item-image {
    width: 100%;
    height: 160px;
    margin: 0;
    background: #f8f9fa;
    border-radius: 0;
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: relative;
    overflow: hidden;
    padding: 20px;
    margin-top: 8px;
}

.cart-item.grid-view .item-image img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

.cart-item.grid-view .item-image-placeholder {
    font-size: 48px;
    color: #adb5bd;
}

/* Quantity Control - Below Image */
.cart-item.grid-view .quantity-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    background: white;
    padding: 12px 16px;
    border-radius: 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    order: 3;
}

.cart-item.grid-view .quantity-control .qty-btn-circle {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border: 2px solid #28a745;
    background: white;
    color: #28a745;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cart-item.grid-view .quantity-control .qty-btn-circle:hover {
    background: #28a745;
    border-color: #28a745;
    color: white;
    transform: scale(1.05);
}

.cart-item.grid-view .qty-value {
    font-size: 20px;
    font-weight: 700;
    min-width: auto;
    color: #2c3e50;
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Item Details */
.cart-item.grid-view .item-details {
    text-align: center;
    margin: 0;
    padding: 14px 16px 10px 16px;
    min-height: auto;
    order: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.cart-item.grid-view .item-company {
    font-size: 10px;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.cart-item.grid-view .item-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: #2c3e50;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item.grid-view .item-size {
    font-size: 11px;
    color: #6c757d;
    margin: 4px 0 0 0;
    padding: 0;
    font-weight: 500;
    background: transparent;
    border-radius: 0;
    display: block;
    text-align: center;
    line-height: 1.3;
}

/* Price Section - Footer */
.cart-item.grid-view .item-price {
    text-align: center;
    align-items: center;
    margin: 0;
    padding: 14px 16px 16px 16px;
    background: white;
    border: none;
    order: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item.grid-view .price-current {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
    letter-spacing: -0.5px;
    line-height: 1;
}

.cart-item.grid-view .price-original {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
    line-height: 1;
}

/* Hide unit badge in grid view */
.cart-item.grid-view .item-unit {
    display: none;
}

/* Additional item details styles */
.item-company {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.item-barcode {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.item-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.item-meta-inline span {
    font-size: 11px;
    color: #6b7280;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.item-unit {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 6px;
}

/* Quantity buttons - circular style */
.qty-btn-circle {
    width: 28px;
    height: 28px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s;
    padding: 0;
}

.qty-btn-circle:hover {
    background: #3ebc5e;
    border-color: #3ebc5e;
    color: white;
    transform: scale(1.05);
}

.qty-btn-circle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.qty-btn-circle:disabled:hover {
    background: white;
    border-color: #e5e7eb;
    color: #6b7280;
    transform: none;
}

/* Remove button - X style */
.btn-remove-form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-x {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-remove-x:hover {
    color: #ef4444;
    background: #fee2e2;
    transform: scale(1.1);
}

/* =================================================================
   RESPONSIVE STYLES - MOBILE OPTIMIZATION
   ================================================================= */

/* Tablet Styles */
@media (max-width: 1024px) {
    .row {
        flex-direction: column;
    }

    .checkout-section {
        width: 100%;
        margin-top: 20px;
    }

    .cart-section {
        width: 100%;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Top Bar */
    .cart-page .top-bar,
    .checkout-page .top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        font-size: 11px;
        padding: 10px 15px;
        border-radius: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Container */
    .container-fluid {
        padding: 60px 16px 70px;
        max-width: 100%;
    }

    /* Row - Stack sections vertically */
    .row {
        flex-direction: column;
        gap: 20px;
        margin: 0;
    }

    /* Cart and Checkout Sections */
    .cart-section,
    .checkout-section {
        padding: 18px;
        border-radius: 20px;
        width: 100%;
        margin: 0;
    }

    .checkout-section {
        width: 100%;
        order: 2;
    }

    /* Section Header */
    .section-header {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 18px;
        align-items: center;
        justify-content: space-between;
    }

    .section-title {
        font-size: 16px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .cart-icon {
        font-size: 18px;
    }

    .cart-count {
        font-size: 11px;
        padding: 3px 8px;
        margin-left: 6px;
    }

    .view-toggle {
        width: auto;
        justify-content: flex-end;
        gap: 6px;
    }

    .view-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Barcode Search Section */
    .barcode-search-section {
        margin-bottom: 18px;
    }

    .search-scanner-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .barcode-search {
        width: 100%;
        padding: 10px 14px;
    }

    .barcode-search > i {
        font-size: 18px;
    }

    .barcode-input {
        font-size: 14px;
    }

    .btn-search {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
    }

    .scanner-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-scanner {
        flex: 1;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .btn-scanner i {
        font-size: 18px;
    }

    .btn-scanner span {
        display: inline;
    }

    /* Grid View - Mobile Optimization */
    .cart-items-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .cart-item.grid-view {
        border-radius: 16px;
    }

    .cart-item.grid-view .item-image {
        height: 140px;
        padding: 15px;
    }

    .cart-item.grid-view .item-category {
        font-size: 7px;
        padding: 3px 8px;
        top: 8px;
        left: 8px;
    }

    .cart-item.grid-view .btn-remove-x {
        width: 24px;
        height: 24px;
        font-size: 14px;
        top: 6px;
        right: 6px;
    }

    .cart-item.grid-view .item-barcode {
        padding: 8px 10px;
        min-height: 40px;
    }

    .cart-item.grid-view .item-barcode img {
        height: 24px;
    }

    .cart-item.grid-view .quantity-control {
        padding: 10px 12px;
    }

    .cart-item.grid-view .quantity-control .qty-btn-circle {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .cart-item.grid-view .qty-value {
        font-size: 18px;
    }

    .cart-item.grid-view .item-details {
        padding: 12px 12px 8px 12px;
    }

    .cart-item.grid-view .item-company {
        font-size: 9px;
    }

    .cart-item.grid-view .item-name {
        font-size: 13px;
    }

    .cart-item.grid-view .item-size {
        font-size: 10px;
    }

    .cart-item.grid-view .item-price {
        padding: 12px 12px 14px 12px;
    }

    .cart-item.grid-view .price-current {
        font-size: 20px;
    }

    .cart-item.grid-view .price-original {
        font-size: 11px;
    }

    /* List View - Mobile Optimization */
    .cart-item.list-view {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
        min-height: auto;
    }

    .cart-item.list-view .item-image {
        width: 50px;
        height: 50px;
        border-radius: 8px;
    }

    .cart-item.list-view .item-details {
        flex: 1;
        min-width: 120px;
        gap: 3px;
    }

    .cart-item.list-view .item-company {
        font-size: 9px;
    }

    .cart-item.list-view .item-name {
        font-size: 13px;
    }

    .cart-item.list-view .item-size {
        font-size: 10px;
        padding: 2px 8px;
    }

    .cart-item.list-view .item-barcode {
        order: 10;
        width: 100%;
        padding: 8px;
        min-height: 36px;
    }

    .cart-item.list-view .item-barcode img {
        height: 24px;
    }

    .cart-item.list-view .quantity-control {
        order: 11;
        padding: 6px 10px;
        gap: 8px;
    }

    .cart-item.list-view .item-price {
        order: 12;
        min-width: auto;
        align-items: flex-end;
        flex: 1;
        margin-left: auto;
    }

    .cart-item.list-view .price-current {
        font-size: 16px;
    }

    .cart-item.list-view .price-original {
        font-size: 11px;
    }

    .cart-item.list-view .btn-remove-x {
        width: 28px;
        height: 28px;
        font-size: 16px;
        margin-left: 0;
        position: absolute;
        top: 8px;
        right: 8px;
    }

    /* Cart Footer */
    .cart-footer {
        margin-top: 20px;
        gap: 10px;
    }

    .btn-cancel,
    .btn-help {
        width: 70px;
        height: 70px;
        font-size: 10px;
    }

    .btn-cancel i,
    .btn-help i {
        font-size: 18px;
        margin-bottom: 3px;
    }

    /* Checkout Section */
    .checkout-header {
        padding: 15px;
    }

    .checkout-title {
        font-size: 18px;
    }

    .order-summary {
        padding: 15px;
        gap: 10px;
    }

    .summary-row {
        font-size: 14px;
    }

    .summary-row.total {
        font-size: 16px;
        padding-top: 12px;
    }

    /* Tap to Pay */
    .tap-to-pay-container {
        padding: 20px 15px;
    }

    .tap-card-display {
        width: 100px;
        height: 65px;
    }

    .tap-to-pay-text {
        font-size: 16px;
    }

    .supported-cards {
        gap: 8px;
    }

    .card-icon {
        width: 35px;
        height: 24px;
    }

    /* Empty Cart */
    .empty-cart {
        padding: 40px 20px;
    }

    .empty-cart i {
        font-size: 60px;
    }

    .empty-cart h5 {
        font-size: 18px;
    }

    .empty-cart p {
        font-size: 13px;
    }

    /* Delete Modal */
    .delete-modal {
        width: 95%;
        max-width: 340px;
    }

    .delete-modal-icon {
        padding: 25px;
    }

    .delete-modal-icon i {
        font-size: 52px;
    }

    .delete-modal-content {
        padding: 20px;
    }

    .delete-modal-content h3 {
        font-size: 20px;
        margin: 0 0 12px 0;
    }

    .delete-modal-content p {
        font-size: 14px;
    }

    .delete-modal-warning {
        font-size: 12px !important;
        padding: 8px;
        margin-top: 12px !important;
    }

    .delete-modal-actions {
        padding: 0 20px 20px 20px;
        gap: 10px;
    }

    .btn-modal-cancel,
    .btn-modal-delete {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* Further reduce padding */
    .container-fluid {
        padding: 50px 12px 65px;
    }

    .cart-page .top-bar,
    .checkout-page .top-bar {
        font-size: 10px;
        padding: 8px 12px;
    }

    .cart-section,
    .checkout-section {
        padding: 12px;
        border-radius: 20px;
    }

    .section-header {
        padding: 10px;
        gap: 8px;
    }

    .section-title {
        font-size: 14px;
    }

    .cart-count {
        font-size: 9px;
        padding: 2px 5px;
    }

    .view-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    /* Barcode Search Section */
    .barcode-search-section {
        margin-bottom: 14px;
    }

    .search-scanner-wrapper {
        gap: 8px;
    }

    .barcode-search {
        padding: 8px 12px;
    }

    .barcode-search > i {
        font-size: 16px;
    }

    .barcode-input {
        font-size: 13px;
    }

    .btn-search {
        width: 34px;
        height: 34px;
    }

    .btn-scanner {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-scanner i {
        font-size: 16px;
    }

    /* Grid View - Smaller Screens */
    .cart-items-container.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .cart-item.grid-view {
        border-radius: 16px;
    }

    .cart-item.grid-view .item-image {
        height: 110px;
        padding: 10px;
    }

    .cart-item.grid-view .item-name {
        font-size: 12px;
    }

    .cart-item.grid-view .price-current {
        font-size: 18px;
    }

    .cart-item.grid-view .btn-remove-x {
        width: 22px;
        height: 22px;
        font-size: 13px;
        top: 5px;
        right: 5px;
    }

    .cart-item.grid-view .item-category {
        font-size: 7px;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
    }

    /* List View - Smaller Screens */
    .cart-items-container {
        gap: 8px;
    }

    .cart-item.list-view {
        padding: 10px;
        border-radius: 12px;
    }

    .cart-item.list-view .item-image {
        width: 45px;
        height: 45px;
    }

    .cart-item.list-view .item-details {
        min-width: 90px;
    }

    .cart-item.list-view .item-company {
        font-size: 8px;
    }

    .cart-item.list-view .item-name {
        font-size: 12px;
    }

    .cart-item.list-view .item-size {
        font-size: 9px;
        padding: 2px 6px;
    }

    .cart-item.list-view .item-barcode {
        padding: 6px;
        min-height: 32px;
    }

    .cart-item.list-view .item-barcode img {
        height: 22px;
    }

    .cart-item.list-view .quantity-control {
        padding: 5px 8px;
        gap: 6px;
    }

    .qty-btn-circle {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .cart-item.list-view .qty-value {
        font-size: 12px;
        min-width: 20px;
    }

    .cart-item.list-view .item-price {
        align-items: flex-end;
        margin-left: auto;
    }

    .cart-item.list-view .price-current {
        font-size: 15px;
    }

    .cart-item.list-view .price-original {
        font-size: 10px;
    }

    .cart-item.list-view .btn-remove-x {
        width: 26px;
        height: 26px;
        font-size: 14px;
        top: 6px;
        right: 6px;
    }

    /* Cart Footer */
    .cart-footer {
        margin-top: 15px;
        gap: 8px;
    }

    .btn-cancel,
    .btn-help {
        width: 65px;
        height: 65px;
        font-size: 9px;
    }

    .btn-cancel i,
    .btn-help i {
        font-size: 16px;
        margin-bottom: 2px;
    }

    /* Checkout Section */
    .checkout-header {
        padding: 12px;
    }

    .checkout-title {
        font-size: 15px;
    }

    .order-summary {
        padding: 12px;
        gap: 8px;
    }

    .summary-row {
        font-size: 13px;
    }

    .summary-row.total {
        font-size: 15px;
        padding-top: 10px;
    }

    .tap-to-pay-container {
        padding: 18px 12px;
    }

    .tap-card-display {
        width: 90px;
        height: 60px;
    }

    .tap-to-pay-text {
        font-size: 13px;
    }

    .supported-cards {
        gap: 6px;
    }

    .card-icon {
        width: 32px;
        height: 22px;
    }

    /* Empty Cart */
    .empty-cart {
        padding: 35px 15px;
    }

    .empty-cart i {
        font-size: 50px;
    }

    .empty-cart h5 {
        font-size: 16px;
    }

    .empty-cart p {
        font-size: 12px;
    }

    /* Delete Modal */
    .delete-modal {
        width: 96%;
        max-width: 320px;
    }

    .delete-modal-icon {
        padding: 20px;
    }

    .delete-modal-icon i {
        font-size: 48px;
    }

    .delete-modal-content {
        padding: 18px;
    }

    .delete-modal-content h3 {
        font-size: 18px;
        margin: 0 0 10px 0;
    }

    .delete-modal-content p {
        font-size: 13px;
    }

    .delete-modal-warning {
        font-size: 11px !important;
        padding: 7px;
        margin-top: 10px !important;
    }

    .delete-modal-actions {
        padding: 0 18px 18px 18px;
        gap: 8px;
        flex-direction: column-reverse;
    }

    .btn-modal-cancel,
    .btn-modal-delete {
        padding: 9px 16px;
        font-size: 13px;
        width: 100%;
    }
}

/* =================================================================
   DELETE MODAL STYLES - FOR TESTING PORTION
   ================================================================= */

.delete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.delete-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    padding: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.delete-modal-overlay.active .delete-modal {
    transform: scale(1) translateY(0);
}

.delete-modal-icon {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.delete-modal-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.delete-modal-icon i {
    font-size: 64px;
    color: white;
    position: relative;
    z-index: 1;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.delete-modal-content {
    padding: 30px;
    text-align: center;
}

.delete-modal-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.delete-modal-content p {
    font-size: 16px;
    color: #6c757d;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.delete-modal-content p strong {
    color: #2c3e50;
    font-weight: 600;
}

.delete-modal-warning {
    font-size: 14px !important;
    color: #ff6b6b !important;
    font-weight: 600;
    margin-top: 15px !important;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
}

.delete-modal-actions {
    display: flex;
    gap: 12px;
    padding: 0 30px 30px 30px;
}

.btn-modal-cancel,
.btn-modal-delete {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-modal-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-modal-cancel:hover {
    background: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-modal-delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-modal-delete:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #d64545 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.btn-modal-cancel i,
.btn-modal-delete i {
    font-size: 18px;
}

/* Responsive Styles for Delete Modal */
@media (max-width: 768px) {
    .delete-modal {
        max-width: 90%;
        margin: 20px;
    }

    .delete-modal-icon {
        padding: 25px;
    }

    .delete-modal-icon i {
        font-size: 48px;
    }

    .delete-modal-content {
        padding: 20px;
    }

    .delete-modal-content h3 {
        font-size: 20px;
    }

    .delete-modal-content p {
        font-size: 14px;
    }

    .delete-modal-actions {
        flex-direction: column-reverse;
        padding: 0 20px 20px 20px;
    }

    .btn-modal-cancel,
    .btn-modal-delete {
        width: 100%;
    }
}

/* =================================================================
   SCANNER MODAL STYLES
   ================================================================= */



/* =================================================================
   BARCODE SCANNER MODAL - PROPER MODAL DESIGN
   ================================================================= */

.scanner-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* width: 100vw; */
    /* height: 100vh; */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scanner-modal-overlay.active {
    display: flex !important;
}

/* Modal Box */
.scanner-modal-box {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalZoomIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header */
.scanner-modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.scanner-modal-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-modal-header h5 i {
    font-size: 20px;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Modal Body */
.scanner-modal-body {
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ed 100%);
    padding: 30px;
    min-height: 450px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading State */
.scanner-loading-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
}

.scanner-loading-center .spinner-border {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.scanner-loading-center p {
    margin: 0;
    color: #28a745;
    font-size: 15px;
    font-weight: 500;
}

/* Video Container */
.scanner-video-container {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: #000;
    position: relative;
}

#scanner-video {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

#scanner-video > div {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

#scanner-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

#scanner-video canvas {
    display: none !important;
}

/* Scanner Frame Overlay */
.scanner-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.scanner-frame {
    position: relative;
    width: 70%;
    max-width: 320px;
    aspect-ratio: 3/2;
}

/* Corner Frames - White Brackets */
.corner-frame {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* Animated Scanning Line */
.scanning-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    box-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0%, 100% {
        top: 0;
        opacity: 0.5;
    }
    50% {
        top: calc(100% - 3px);
        opacity: 1;
    }
}

/* Modal Footer */
.scanner-modal-footer {
    background: white;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scanner-info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
}

.scanner-info-text i {
    font-size: 16px;
    color: #28a745;
}

.scanner-cart-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ed 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.cart-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #28a745;
}

.cart-info-item i {
    font-size: 18px;
}

.cart-info-divider {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, transparent, #28a745, transparent);
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scanner-modal-box {
        max-width: 95%;
        margin: 10px;
    }

    .scanner-modal-header {
        padding: 16px 20px;
    }

    .scanner-modal-header h5 {
        font-size: 16px;
    }

    .scanner-modal-body {
        padding: 20px;
        min-height: 400px;
    }

    .scanner-video-container {
        max-width: 100%;
    }

    .scanner-frame {
        width: 75%;
        max-width: 280px;
    }

    .corner-frame {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }

    .scanner-loading-center .spinner-border {
        width: 50px;
        height: 50px;
    }

    .scanner-loading-center p {
        font-size: 14px;
    }

    .scanner-modal-footer {
        padding: 12px 20px;
    }

    .scanner-info-text {
        font-size: 12px;
    }

    .cart-info-item {
        font-size: 14px;
    }

    .scanner-cart-info {
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .scanner-modal-box {
        border-radius: 16px;
    }

    .scanner-modal-body {
        padding: 15px;
        min-height: 350px;
    }

    .scanner-frame {
        width: 80%;
    }

    .corner-frame {
        width: 35px;
        height: 35px;
        border-width: 2.5px;
    }

    .btn-close-modal {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .cart-info-item {
        font-size: 13px;
    }

    .cart-info-item i {
        font-size: 16px;
    }

    .scanner-cart-info {
        padding: 8px 12px;
        gap: 12px;
    }
}
