/* Updated for better large screen responsiveness - v2 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-size: 14px;
}

/* Responsive body padding and font sizes */
@media (min-width: 1024px) {
    body {
        padding: 30px;
        font-size: 15px;
    }
}

@media (min-width: 1200px) {
    body {
        font-size: 16px;
    }
}

@media (min-width: 1440px) {
    body {
        font-size: 17px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding: 20px;
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    body {
        padding: 10px;
        font-size: 13px;
    }
}

.pos-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    max-height: 800px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

/* Header */
.pos-header {
    background: linear-gradient(135deg, #fca311, #e67e22);
    color: white;
    padding: 15px 20px;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.store-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.store-info {
    text-align: left;
}

.store-info h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.date-time {
    font-size: 12px;
    opacity: 0.9;
}

.admin-features {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    min-width: 80px;
    justify-content: center;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-btn i {
    font-size: 14px;
}

.admin-btn span {
    font-size: 11px;
    white-space: nowrap;
}

/* Responsive admin buttons */
@media (max-width: 768px) {
    .admin-features {
        gap: 4px;
        margin-right: 8px;
    }
    
    .admin-btn {
        padding: 6px 8px;
        min-width: 60px;
        font-size: 10px;
    }
    
    .admin-btn span {
        display: none;
    }
    
    .admin-btn i {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .admin-features {
        flex-direction: column;
        gap: 2px;
    }
    
    .admin-btn {
        padding: 4px 6px;
        min-width: 40px;
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.user-shift {
    font-size: 0.8rem;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 2px;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    white-space: nowrap;
}

.logout-text {
    font-size: 12px;
    font-weight: 600;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

/* Category Navigation */
.category-nav {
    display: flex;
    background: #e5e5e5;
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
    text-align: center;
    line-height: 1.2;
}

.category-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #fca311;
    color: white;
    border-color: #fca311;
}

/* Main Content */
.pos-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Product Section */
.product-section {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #fca311;
}

.product-image {
    width: 100%;
    height: 35px;
    background: #e5e5e5;
    border-radius: 3px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
}

.product-name {
    font-size: 10px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    line-height: 1.2;
    height: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 11px;
    font-weight: 700;
    color: #fca311;
}

.product-category {
    position: absolute;
    top: 1px;
    right: 1px;
    background: rgba(252, 163, 17, 0.9);
    color: white;
    font-size: 6px;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Cart Section */
.cart-section {
    width: 180px;
    background: #e5e5e5;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 8px;
    background: #d5d5d5;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 12px;
    color: #333;
}

.clear-cart-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 9px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-cart-btn:hover {
    background: #c82333;
}

.cart-items {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.empty-cart {
    text-align: center;
    color: #999;
    font-size: 11px;
    margin-top: 20px;
}

.cart-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    margin-bottom: 6px;
    font-size: 10px;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 9px;
    line-height: 1.2;
    flex: 1;
}

.delete-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    margin-left: 4px;
}

.delete-item-btn:hover {
    background: #c82333;
}

.rental-info-display {
    background: #f8f9fa;
    padding: 4px 6px;
    border-radius: 3px;
    margin: 2px 0;
    font-size: 7px;
}

.rental-time {
    color: #fca311;
    font-weight: 600;
    margin-bottom: 1px;
}

.rental-duration {
    color: #666;
    font-weight: 500;
}

.cart-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: #666;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn-small {
    background: #fca311;
    color: white;
    border: none;
    border-radius: 3px;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn-small:hover {
    background: #e67e22;
}

.qty-input {
    width: 30px;
    height: 16px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 600;
    background: white;
    color: #333;
}

.qty-input:focus {
    outline: none;
    border-color: #fca311;
    box-shadow: 0 0 0 1px #fca311;
}

.cart-item-total {
    font-weight: 600;
    color: #fca311;
}

.cart-total {
    padding: 8px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
}

.total-row.total {
    font-weight: 700;
    font-size: 12px;
    color: #333;
    border-top: 1px solid #e0e0e0;
    padding-top: 6px;
    margin-top: 6px;
}

.cart-actions {
    padding: 8px;
    background: #e5e5e5;
}

.checkout-btn {
    width: 100%;
    background: #fca311;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkout-btn:hover {
    background: #e67e22;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Payment Methods */
.payment-methods {
    padding: 8px;
    background: #e5e5e5;
    border-top: 1px solid #e0e0e0;
}

.payment-methods h4 {
    font-size: 10px;
    color: #333;
    margin-bottom: 6px;
    text-align: center;
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.payment-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 4px;
    font-size: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.payment-btn:hover {
    background: #e9ecef;
    border-color: #fca311;
}

.payment-btn.active {
    background: #fca311;
    color: white;
    border-color: #fca311;
}

.payment-icon {
    font-size: 12px;
    margin-bottom: 2px;
}

.payment-text {
    font-size: 7px;
    font-weight: 600;
}

/* Thermal Receipt Styles */
.thermal-receipt {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.2;
    max-width: 300px;
    margin: 0 auto;
    padding: 10px;
    background: white;
    border: 1px solid #ccc;
}

.thermal-receipt .header {
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px dashed #000;
    padding-bottom: 5px;
}

.thermal-receipt .item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.thermal-receipt .total {
    border-top: 1px dashed #000;
    padding-top: 5px;
    margin-top: 10px;
    font-weight: bold;
}

.thermal-receipt .footer {
    text-align: center;
    margin-top: 10px;
    font-size: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    margin-bottom: 10px;
    color: #333;
}

.modal-content p {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 20px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.qty-btn {
    background: #fca311;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e67e22;
}

#quantity {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    font-size: 16px;
}

.add-to-cart-btn {
    background: #fca311;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #e67e22;
}

/* Cash Payment Modal */
.payment-info {
    margin-bottom: 20px;
}

.payment-info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.payment-info label {
    font-weight: 600;
    color: #333;
}

.payment-info span {
    font-weight: 700;
    font-size: 16px;
}

.total-amount span {
    color: #2c3e50;
}

.change-amount span {
    color: #27ae60;
}

.amount-paid input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    text-align: right;
}

.amount-paid input:focus {
    border-color: #fca311;
    outline: none;
}

.quick-amounts {
    margin-top: 20px;
}

.quick-amounts h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.quick-btn {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #fca311;
    color: white;
    border-color: #fca311;
}

#confirmCashPayment:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Rental Modal Styles */
.rental-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.rental-product, .rental-price {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rental-product:last-child, .rental-price:last-child {
    margin-bottom: 0;
}

.rental-product label, .rental-price label {
    font-weight: 600;
    color: #333;
}

.rental-product span, .rental-price span {
    color: #fca311;
    font-weight: 700;
}

.rental-time-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.time-input-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.time-input-group input[type="time"] {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.time-input-group input[type="time"]:focus {
    outline: none;
    border-color: #fca311;
}

.duration-display, .total-rental-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #e5e5e5;
    border-radius: 5px;
}

.duration-display label, .total-rental-price label {
    font-weight: 600;
    color: #333;
}

.duration-display span, .total-rental-price span {
    color: #fca311;
    font-weight: 700;
    font-size: 16px;
}

#confirmRental:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#confirmCashPayment:disabled:hover {
    background: #ccc;
}

/* Mobile-First Responsive Design - Updated for Desktop Scaling */

/* Desktop and Large Tablets */
@media (min-width: 1024px) {
    .pos-container {
        max-width: 1400px !important;
        height: 90vh !important;
        max-height: 900px !important;
    }
    
    .pos-main {
        height: calc(100vh - 140px) !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }
    
    .product-card {
        padding: 12px !important;
        min-height: 140px !important;
    }
    
    .product-image {
        height: 80px !important;
        font-size: 28px !important;
    }
    
    .product-name {
        font-size: 12px !important;
        min-height: 28px !important;
    }
    
    .product-price {
        font-size: 13px !important;
    }
    
    .cart-section {
        width: 300px !important;
    }
    
    .cart-items {
        max-height: 300px;
    }
    
    .cart-item {
        padding: 10px;
        font-size: 12px;
    }
    
    .cart-item-name {
        font-size: 11px;
    }
    
    .qty-btn-small {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .qty-input {
        width: 40px;
        height: 24px;
        font-size: 12px;
    }
    
    .total-row {
        font-size: 13px;
    }
    
    .total-row.total {
        font-size: 15px;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .payment-btn {
        padding: 10px 8px;
        font-size: 10px;
    }
    
    .payment-icon {
        font-size: 16px;
    }
    
    .payment-text {
        font-size: 9px;
    }
    
    .checkout-btn {
        padding: 15px;
        font-size: 16px;
    }
}

/* Medium Tablets and Small Desktops */
@media (min-width: 768px) and (max-width: 1023px) {
    .pos-container {
        max-width: 1000px !important;
        height: 95vh !important;
        max-height: 850px !important;
    }
    
    .pos-main {
        height: calc(100vh - 130px) !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
    
    .product-card {
        padding: 10px !important;
        min-height: 130px !important;
    }
    
    .product-image {
        height: 70px !important;
        font-size: 26px !important;
    }
    
    .product-name {
        font-size: 11px !important;
        min-height: 26px !important;
    }
    
    .product-price {
        font-size: 12px !important;
    }
    
    .cart-section {
        width: 250px !important;
    }
    
    .cart-items {
        max-height: 250px;
    }
    
    .cart-item {
        padding: 8px;
        font-size: 11px;
    }
    
    .cart-item-name {
        font-size: 10px;
    }
    
    .qty-btn-small {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }
    
    .qty-input {
        width: 38px;
        height: 22px;
        font-size: 11px;
    }
    
    .total-row {
        font-size: 12px;
    }
    
    .total-row.total {
        font-size: 14px;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .payment-btn {
        padding: 8px 6px;
        font-size: 9px;
    }
    
    .payment-icon {
        font-size: 14px;
    }
    
    .payment-text {
        font-size: 8px;
    }
    
    .checkout-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Large Mobile and Small Tablets */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: #f5f5f5;
    }
    
    .pos-container {
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        max-height: none !important;
        box-shadow: none !important;
        max-width: 100% !important;
    }
    
    .pos-header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    
    .logo-section {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    
    .store-logo {
        width: 45px;
        height: 45px;
    }
    
    .store-info h1 {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .date-time {
        font-size: 11px;
    }
    
    .user-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-top: 5px;
    }
    
    .user-details {
        align-items: flex-start;
        text-align: left;
    }
    
    .user-name {
        font-size: 0.85rem;
    }
    
    .user-shift {
        font-size: 0.75rem;
        padding: 1px 4px;
    }
    
    .logout-btn {
        padding: 6px 10px;
        height: 32px;
        font-size: 12px;
    }
    
    .logout-text {
        font-size: 10px;
    }
    
    .category-nav {
        padding: 8px 10px;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-btn {
        padding: 14px 24px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 130px;
        text-align: center;
        line-height: 1.2;
    }
    
    .pos-main {
        flex-direction: column;
        height: calc(100vh - 140px);
    }
    
    .product-section {
        flex: 1;
        padding: 10px;
        min-height: 0;
        max-height: calc(100vh - 500px);
        overflow-y: auto;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        padding: 8px;
        border-radius: 8px;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .product-image {
        height: 60px;
        font-size: 24px;
        border-radius: 6px;
    }
    
    .product-name {
        font-size: 11px;
        height: auto;
        min-height: 24px;
        line-height: 1.2;
        margin-bottom: 5px;
    }
    
    .product-price {
        font-size: 12px;
        font-weight: 700;
    }
    
    .product-category {
        font-size: 7px;
        padding: 2px 4px;
        border-radius: 3px;
    }
    
    .cart-section {
        width: 100%;
        height: 450px;
        border-left: none;
        border-top: 2px solid #e0e0e0;
        order: 2;
        display: flex;
        flex-direction: column;
        min-height: 450px;
        max-height: 450px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #fca311 #e5e5e5;
    }
    
    .cart-section::-webkit-scrollbar {
        width: 8px;
    }
    
    .cart-section::-webkit-scrollbar-track {
        background: #e5e5e5;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb {
        background: #fca311;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb:hover {
        background: #e67e22;
    }
    
    .cart-header {
        padding: 8px 12px;
        flex-shrink: 0;
        background: #d5d5d5;
    }
    
    .cart-header h3 {
        font-size: 14px;
    }
    
    .clear-cart-btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .cart-items {
        padding: 8px;
        max-height: 120px;
        flex: 0 0 auto;
        overflow-y: auto;
        background: #f8f9fa;
    }
    
    .cart-item {
        padding: 6px;
        margin-bottom: 6px;
        font-size: 10px;
    }
    
    .cart-item-name {
        font-size: 9px;
    }
    
    .qty-btn-small {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    
    .qty-input {
        width: 32px;
        height: 18px;
        font-size: 9px;
    }
    
    .cart-total {
        padding: 8px;
        flex-shrink: 0;
        background: white;
    }
    
    .total-row {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .total-row.total {
        font-size: 13px;
        padding-top: 6px;
    }
    
    .payment-methods {
        padding: 8px;
        flex-shrink: 0;
        background: #e5e5e5;
        border-top: 1px solid #ddd;
    }
    
    .payment-methods h4 {
        font-size: 11px;
        margin-bottom: 6px;
        text-align: center;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .payment-btn {
        padding: 6px 4px;
        font-size: 8px;
        min-height: 40px;
        min-width: 40px;
    }
    
    .payment-icon {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .payment-text {
        font-size: 7px;
    }
    
    .cart-actions {
        padding: 8px;
        flex-shrink: 0;
        background: #e5e5e5;
        border-top: 1px solid #ddd;
    }
    
    .checkout-btn {
        padding: 15px;
        font-size: 16px;
        font-weight: 700;
        min-height: 50px;
        width: 100%;
        background: #fca311;
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .checkout-btn:hover {
        background: #e67e22;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .checkout-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .checkout-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .pos-header {
        padding: 8px 12px;
    }
    
    .store-info h1 {
        font-size: 16px;
    }
    
    .date-time {
        font-size: 10px;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .user-shift {
        font-size: 0.7rem;
    }
    
    .logout-btn {
        padding: 5px 8px;
        height: 30px;
        font-size: 11px;
    }
    
    .category-nav {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .category-btn {
        padding: 12px 22px;
        font-size: 12px;
        min-width: 120px;
        line-height: 1.2;
    }
    
    .pos-main {
        height: calc(100vh - 120px);
    }
    
    .product-section {
        padding: 8px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card {
        padding: 6px;
        min-height: 110px;
    }
    
    .product-image {
        height: 50px;
        font-size: 20px;
    }
    
    .product-name {
        font-size: 10px;
        min-height: 20px;
    }
    
    .product-price {
        font-size: 11px;
    }
    
    .cart-section {
        height: 420px;
        min-height: 420px;
        max-height: 420px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #fca311 #e5e5e5;
    }
    
    .cart-section::-webkit-scrollbar {
        width: 8px;
    }
    
    .cart-section::-webkit-scrollbar-track {
        background: #e5e5e5;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb {
        background: #fca311;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb:hover {
        background: #e67e22;
    }
    
    .cart-items {
        max-height: 100px;
    }
    
    .cart-item {
        padding: 6px;
        font-size: 10px;
    }
    
    .cart-item-name {
        font-size: 9px;
    }
    
    .qty-btn-small {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .qty-input {
        width: 30px;
        height: 18px;
        font-size: 9px;
    }
    
    .total-row {
        font-size: 11px;
    }
    
    .total-row.total {
        font-size: 13px;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .payment-btn {
        padding: 6px 4px;
        font-size: 8px;
        min-height: 40px;
        min-width: 40px;
    }
    
    .payment-icon {
        font-size: 12px;
    }
    
    .payment-text {
        font-size: 7px;
    }
    
    .checkout-btn {
        padding: 12px;
        font-size: 14px;
        min-height: 45px;
        font-weight: 700;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 360px) {
    .pos-header {
        padding: 6px 10px;
    }
    
    .store-info h1 {
        font-size: 14px;
    }
    
    .date-time {
        font-size: 9px;
    }
    
    .category-nav {
        padding: 4px 6px;
    }
    
    .category-btn {
        padding: 10px 20px;
        font-size: 11px;
        min-width: 110px;
        line-height: 1.2;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .product-card {
        padding: 4px;
        min-height: 100px;
    }
    
    .product-image {
        height: 45px;
        font-size: 18px;
    }
    
    .product-name {
        font-size: 9px;
        min-height: 18px;
    }
    
    .product-price {
        font-size: 10px;
    }
    
    .cart-section {
        height: 400px;
        min-height: 400px;
        max-height: 400px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: #fca311 #e5e5e5;
    }
    
    .cart-section::-webkit-scrollbar {
        width: 8px;
    }
    
    .cart-section::-webkit-scrollbar-track {
        background: #e5e5e5;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb {
        background: #fca311;
        border-radius: 4px;
    }
    
    .cart-section::-webkit-scrollbar-thumb:hover {
        background: #e67e22;
    }
    
    .cart-items {
        max-height: 90px;
    }
    
    .cart-item {
        padding: 4px;
        font-size: 9px;
    }
    
    .cart-item-name {
        font-size: 8px;
    }
    
    .qty-btn-small {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .qty-input {
        width: 28px;
        height: 16px;
        font-size: 8px;
    }
    
    .total-row {
        font-size: 10px;
    }
    
    .total-row.total {
        font-size: 12px;
    }
    
    .payment-btn {
        padding: 4px 3px;
        font-size: 7px;
        min-height: 36px;
        min-width: 36px;
    }
    
    .payment-icon {
        font-size: 10px;
    }
    
    .payment-text {
        font-size: 6px;
    }
    
    .checkout-btn {
        padding: 10px;
        font-size: 13px;
        min-height: 40px;
        font-weight: 700;
    }
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 400px;
        margin: 10px;
        padding: 15px;
    }
    
    .modal-content h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .quantity-controls {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .qty-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    #quantity {
        width: 70px;
        font-size: 16px;
    }
    
    .add-to-cart-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .payment-info > div {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .payment-info label {
        font-size: 14px;
    }
    
    .payment-info span {
        font-size: 16px;
    }
    
    .amount-paid input {
        padding: 8px;
        font-size: 16px;
    }
    
    .quick-amounts h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .quick-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .quick-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .rental-info {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .rental-product, .rental-price {
        margin-bottom: 6px;
    }
    
    .rental-time-inputs {
        gap: 12px;
    }
    
    .time-input-group label {
        font-size: 13px;
    }
    
    .time-input-group input[type="time"] {
        padding: 8px;
        font-size: 14px;
    }
    
    .duration-display, .total-rental-price {
        padding: 8px;
    }
    
    .duration-display label, .total-rental-price label {
        font-size: 13px;
    }
    
    .duration-display span, .total-rental-price span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        margin: 5px;
        padding: 12px;
    }
    
    .modal-content h3 {
        font-size: 16px;
    }
    
    .quantity-controls {
        gap: 8px;
    }
    
    .qty-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    #quantity {
        width: 60px;
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-btn {
        padding: 5px 6px;
        font-size: 10px;
    }
}

/* Touch and Mobile Optimizations */
@media (max-width: 768px) {
    /* Improve touch targets */
    .category-btn,
    .product-card,
    .payment-btn,
    .checkout-btn,
    .qty-btn-small,
    .delete-item-btn,
    .clear-cart-btn {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Ensure bayar button is always visible and accessible */
    .checkout-btn {
        min-height: 50px !important;
        min-width: 100% !important;
        position: relative;
        z-index: 10;
        background: #fca311 !important;
        color: white !important;
        border: 2px solid #e67e22 !important;
        box-shadow: 0 3px 6px rgba(0,0,0,0.2) !important;
        margin-top: auto !important;
        flex-shrink: 0 !important;
    }
    
    .checkout-btn:disabled {
        background: #ccc !important;
        border-color: #999 !important;
        box-shadow: none !important;
    }
    
    /* Ensure cart section is properly structured for mobile */
    .cart-section {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-width: thin !important;
        scrollbar-color: #fca311 #e5e5e5 !important;
    }
    
    .cart-section::-webkit-scrollbar {
        width: 8px !important;
    }
    
    .cart-section::-webkit-scrollbar-track {
        background: #e5e5e5 !important;
        border-radius: 4px !important;
    }
    
    .cart-section::-webkit-scrollbar-thumb {
        background: #fca311 !important;
        border-radius: 4px !important;
    }
    
    .cart-section::-webkit-scrollbar-thumb:hover {
        background: #e67e22 !important;
    }
    
    .cart-actions {
        position: sticky !important;
        bottom: 0 !important;
        background: linear-gradient(to top, #e5e5e5 0%, #e5e5e5 80%, rgba(229, 229, 229, 0.9) 100%) !important;
        border-top: 2px solid #ddd !important;
        padding: 10px !important;
        z-index: 100 !important;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1) !important;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px;
    }
    
    /* Improve button hover states for touch */
    .product-card:active {
        transform: scale(0.98);
    }
    
    .category-btn:active,
    .payment-btn:active,
    .checkout-btn:active {
        transform: scale(0.95);
    }
    
    /* Better scrolling on mobile */
    .product-section,
    .cart-items {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Prevent text selection on UI elements */
    .category-btn,
    .product-card,
    .payment-btn,
    .checkout-btn,
    .qty-btn-small,
    .delete-item-btn,
    .clear-cart-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Improve modal positioning on mobile */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        margin: 0;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .pos-main {
        flex-direction: row;
        height: calc(100vh - 100px);
    }
    
    .product-section {
        flex: 2;
    }
    
    .cart-section {
        flex: 1;
        height: auto;
        border-left: 2px solid #e0e0e0;
        border-top: none;
        order: 1;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .cart-items {
        max-height: 200px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card,
    .category-btn,
    .payment-btn {
        border-width: 0.5px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile-specific scrollbar */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 2px;
    }
    
    .category-nav::-webkit-scrollbar {
        height: 2px;
    }
}

/* Force desktop styles to override mobile */
@media (min-width: 769px) {
    .pos-container {
        max-width: 1200px !important;
        height: 100vh !important;
        max-height: 800px !important;
        border-radius: 15px !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    }
    
    .pos-main {
        flex-direction: row !important;
        height: calc(100vh - 120px) !important;
    }
    
    .product-section {
        flex: 1 !important;
        padding: 15px !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
    
    .product-card {
        padding: 10px !important;
        min-height: 130px !important;
    }
    
    .product-image {
        height: 70px !important;
        font-size: 26px !important;
    }
    
    .product-name {
        font-size: 11px !important;
        min-height: 26px !important;
    }
    
    .product-price {
        font-size: 12px !important;
    }
    
    .cart-section {
        width: 250px !important;
        height: auto !important;
        border-left: 1px solid #e0e0e0 !important;
        border-top: none !important;
        order: 1 !important;
    }
    
    .cart-items {
        max-height: 250px !important;
    }
    
    .cart-item {
        padding: 8px !important;
        font-size: 11px !important;
    }
    
    .cart-item-name {
        font-size: 10px !important;
    }
    
    .qty-btn-small {
        width: 22px !important;
        height: 22px !important;
        font-size: 13px !important;
    }
    
    .qty-input {
        width: 38px !important;
        height: 22px !important;
        font-size: 11px !important;
    }
    
    .total-row {
        font-size: 12px !important;
    }
    
    .total-row.total {
        font-size: 14px !important;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    
    .payment-btn {
        padding: 8px 6px !important;
        font-size: 9px !important;
    }
    
    .payment-icon {
        font-size: 14px !important;
    }
    
    .payment-text {
        font-size: 8px !important;
    }
    
    .checkout-btn {
        padding: 12px !important;
        font-size: 14px !important;
    }
}

/* Extra large desktop screens */
@media (min-width: 1200px) {
    .pos-container {
        max-width: 1600px !important;
        height: 90vh !important;
        max-height: 1000px !important;
    }
    
    .pos-header {
        padding: 20px 30px !important;
    }
    
    .header-content h1 {
        font-size: 28px !important;
    }
    
    .header-content p {
        font-size: 16px !important;
    }
    
    .header-buttons {
        gap: 12px !important;
    }
    
    .header-btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
    }
    
    .product-card {
        padding: 16px !important;
        min-height: 160px !important;
        border-radius: 12px !important;
    }
    
    .product-image {
        height: 90px !important;
        font-size: 32px !important;
        border-radius: 8px !important;
    }
    
    .product-name {
        font-size: 14px !important;
        min-height: 32px !important;
        line-height: 1.3 !important;
    }
    
    .product-price {
        font-size: 15px !important;
        font-weight: 600 !important;
    }
    
    .cart-section {
        width: 350px !important;
    }
    
    .cart-items {
        max-height: 350px !important;
    }
    
    .cart-item {
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    .cart-item-name {
        font-size: 13px !important;
    }
    
    .qty-btn-small {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
    }
    
    .qty-input {
        width: 45px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
    
    .total-row {
        font-size: 15px !important;
    }
    
    .total-row.total {
        font-size: 18px !important;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .payment-btn {
        padding: 12px 10px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }
    
    .payment-icon {
        font-size: 18px !important;
    }
    
    .payment-text {
        font-size: 10px !important;
    }
    
    .checkout-btn {
        padding: 18px !important;
        font-size: 18px !important;
        border-radius: 10px !important;
    }
    
    .category-nav {
        padding: 15px 20px !important;
    }
    
    .category-btn {
        padding: 14px 24px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        min-width: 130px !important;
        line-height: 1.2 !important;
    }
    
    .cart-header h3 {
        font-size: 18px !important;
    }
    
    .empty-cart-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .empty-cart-message {
        font-size: 16px !important;
    }
}

/* Ultra large screens (1440px+) */
@media (min-width: 1440px) {
    .pos-container {
        max-width: 1800px !important;
        height: 85vh !important;
        max-height: 1100px !important;
    }
    
    .pos-header {
        padding: 25px 40px !important;
    }
    
    .header-content h1 {
        font-size: 32px !important;
    }
    
    .header-content p {
        font-size: 18px !important;
    }
    
    .header-buttons {
        gap: 15px !important;
    }
    
    .header-btn {
        padding: 12px 20px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 25px !important;
    }
    
    .product-card {
        padding: 20px !important;
        min-height: 180px !important;
        border-radius: 15px !important;
    }
    
    .product-image {
        height: 100px !important;
        font-size: 36px !important;
        border-radius: 10px !important;
    }
    
    .product-name {
        font-size: 16px !important;
        min-height: 36px !important;
        line-height: 1.3 !important;
    }
    
    .product-price {
        font-size: 17px !important;
        font-weight: 600 !important;
    }
    
    .cart-section {
        width: 400px !important;
    }
    
    .cart-items {
        max-height: 400px !important;
    }
    
    .cart-item {
        padding: 15px !important;
        font-size: 16px !important;
    }
    
    .cart-item-name {
        font-size: 15px !important;
    }
    
    .qty-btn-small {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
    }
    
    .qty-input {
        width: 50px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    
    .total-row {
        font-size: 17px !important;
    }
    
    .total-row.total {
        font-size: 20px !important;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .payment-btn {
        padding: 15px 12px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }
    
    .payment-icon {
        font-size: 20px !important;
    }
    
    .payment-text {
        font-size: 11px !important;
    }
    
    .checkout-btn {
        padding: 20px !important;
        font-size: 20px !important;
        border-radius: 12px !important;
    }
    
    .category-nav {
        padding: 20px 25px !important;
    }
    
    .category-btn {
        padding: 16px 28px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
        min-width: 150px !important;
        line-height: 1.2 !important;
    }
    
    .cart-header h3 {
        font-size: 20px !important;
    }
    
    .empty-cart-btn {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
    
    .empty-cart-message {
        font-size: 18px !important;
    }
}
