* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scroll-container {
    flex: 1;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    height: calc(100vh - 90px); /* Account for status bar height */
    padding-bottom: 80px; /* Extra space for fixed button */
}

.order-summary-top,
.order-summary-bottom {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
}

.order-summary-top::-webkit-scrollbar,
.order-summary-bottom::-webkit-scrollbar {
    display: none;
}

.order-summary-top,
.order-summary-bottom {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
}

.status-bar {
    background: #2c3e50;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    height: 90px;
    min-height: 90px;
    max-height: 90px;
}

.status-bar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.status-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.total-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.status-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#total-price {
    font-size: 18px;
    font-weight: bold;
}

.clear-order-btn {
    background: #27ae60;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.clear-order-btn:hover {
    background: #229954;
}

.clear-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-order-btn:active {
    background: #229954;
    transform: scale(0.95);
}

.clear-order-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.5;
}

.main-section {
    padding-top: 0;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    padding-bottom: 100px;
    margin-bottom: 80px;
}

.products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1;
}

.product-wrapper {
    background: white;
    border: 3px solid #3498db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.product-label {
    padding: 10px 15px;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    background: #ecf0f1;
    border-bottom: 2px solid #3498db;
}

.product-btn-split {
    display: flex;
    flex: 1;
    height: 100%;
}

.product-btn-half {
    flex: 1;
    border: none;
    background: white;
    color: #2c3e50;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-btn-half.decrease {
    flex: 0.25;
    border-right: 2px solid #3498db;
    color: #27ae60;
    font-size: 24px;
    padding: 10px;
}

.product-btn-half.increase {
    background: #27ae60;
    color: white;
}

.increase-split {
    flex: 1;
    display: flex;
    height: 100%;
}

.product-btn-quarter {
    flex: 1;
    border: none;
    background: #27ae60;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #2980b9;
}

.product-btn-quarter:first-child {
    border-left: none;
}

.product-btn-half:active,
.product-btn-quarter:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.product-btn-half.decrease:active {
    background: #27ae60;
    color: white;
}

.product-btn-half.increase:active,
.product-btn-quarter:active {
    background: #229954;
}

.order-item-active {
    color: white;
}

.order-item-empty {
    color: rgba(255, 255, 255, 0.4);
}

.confirm-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #27ae60;
    color: white;
    border: none;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
    z-index: 10;
}

.confirm-btn:active {
    background: #229954;
}

.confirm-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.history-section {
    background: #f5f5f5;
    padding-top: 20px;
    padding-bottom: 100px;
}

.history-container {
    padding: 20px;
    max-width: 100%;
}

.history-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.order-history-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.order-history-item.deleted {
    background: #e8e8e8;
    opacity: 0.6;
    color: #999;
}

.order-history-item.deleted::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #27ae60;
    font-weight: bold;
    z-index: 1;
    pointer-events: none;
}

.order-history-item.deleted > * {
    position: relative;
    z-index: 0;
}

.order-history-item.partial-refund {
    position: relative;
}

.order-history-edited-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff9800;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    opacity: 0.5;
}

.order-history-refund-amount {
    color: #27ae60;
    font-weight: bold;
    margin-top: 5px;
}

.order-history-delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.order-history-delete-btn:hover {
    background: #c0392b;
}

.order-history-delete-btn:active {
    transform: scale(0.95);
}

.order-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    gap: 10px;
}

.order-history-date {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

.order-history-payment {
    font-size: 14px;
    padding: 5px 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.order-history-payment.cash {
    background: #f5f5dc;
    color: #2c3e50;
}

.order-history-payment.venmo {
    background: #008CFF;
    color: white;
}

.order-history-payment.creditcard {
    background: #2c3e50 !important;
    color: white !important;
}

.order-history-payment.cashapp {
    background: #00D632;
    color: white;
}

.order-history-items {
    margin-bottom: 10px;
}

.order-history-item-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.order-history-total {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
    text-align: right;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #eee;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-title {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-btn {
    position: relative;
    overflow: hidden;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.payment-logo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cash-btn {
    background: #f5f5dc;
}

.cash-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.venmo-btn {
    background: #3D95CE;
}

.venmo-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.credit-card-btn {
    background: #f5f5dc;
}

.credit-card-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.cashapp-btn {
    background: #00D632;
}

.cashapp-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.qr-modal-content {
    background: white;
    padding: 20px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    border-radius: 0;
}

.qr-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    border-radius: 0;
}

.qr-close-btn:hover {
    background: #229954;
}

.qr-close-btn:active {
    transform: scale(0.95);
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.qr-username {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.qr-code-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    cursor: pointer;
    transition: opacity 0.2s;
}

.qr-code-image:hover {
    opacity: 0.9;
}

.qr-code-image:active {
    opacity: 0.8;
}

.modal-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 20px;
    text-align: center;
}

.delete-reason-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.delete-reason-btn {
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #27ae60;
    background: #27ae60;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.delete-reason-btn:hover {
    background: #27ae60;
    color: white;
}

.delete-reason-btn:active {
    transform: scale(0.98);
}

.other-reason-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.other-reason-input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    width: 100%;
}

.other-reason-input:focus {
    outline: none;
    border-color: #27ae60;
}

.delete-confirm-btn {
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    background: #27ae60;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.delete-confirm-btn:hover {
    background: #229954;
}

.delete-confirm-btn:active {
    transform: scale(0.98);
}

.partial-refund-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.partial-refund-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f5f5f5;
    border: 2px solid #ddd;
}

.partial-refund-item-info {
    flex: 1;
}

.partial-refund-item-name {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.partial-refund-item-qty {
    font-size: 14px;
    color: #7f8c8d;
}

.partial-refund-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.partial-refund-qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #27ae60;
    background: #27ae60;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.partial-refund-qty-btn:hover {
    background: #229954;
    color: white;
}

.partial-refund-qty-btn:active {
    transform: scale(0.95);
}

.partial-refund-qty-display {
    min-width: 50px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.partial-refund-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #ecf0f1;
    margin-bottom: 20px;
    border: 2px solid #3498db;
}

.refund-total-label {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.refund-total-amount {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
}

.partial-refund-buttons {
    display: flex;
    gap: 15px;
}

.partial-refund-cancel-btn,
.partial-refund-confirm-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.partial-refund-cancel-btn {
    background: #27ae60;
    color: white;
}

.partial-refund-cancel-btn:active {
    background: #229954;
    transform: scale(0.98);
}

.partial-refund-confirm-btn {
    background: #27ae60;
    color: white;
}

.partial-refund-confirm-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.partial-refund-confirm-btn:not(:disabled):active {
    background: #229954;
    transform: scale(0.98);
}

.order-details-content {
    margin-bottom: 20px;
}

.order-details-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.order-details-label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.order-details-value {
    color: #7f8c8d;
}

.order-details-close-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    background: #27ae60;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.order-details-close-btn:active {
    background: #229954;
    transform: scale(0.98);
}

@media (max-width: 480px) {
    .products {
        grid-template-columns: 1fr;
    }
    
    .product-wrapper {
        min-height: 100px;
    }
    
    .product-label {
        font-size: 22px;
    }
    
    .modal-content {
        width: 85%;
        padding: 25px;
    }
    
    .payment-btn {
        height: 150px;
    }
    
    .payment-logo {
        height: 150px;
        object-fit: contain;
    }
}

