/* Modern Amazon-like POS Styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Amazon Ember', Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    color: #0F1111;
}

.pos-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0;
}

.pos-header {
    background: #232F3E;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.pos-header h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 400;
}

.pos-title-link { 
    color: #fff; 
    text-decoration: none; 
}

.pos-title-link:hover { 
    text-decoration: underline; 
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-reports {
    background: #007185;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-reports:hover {
    background: #005a6b;
    color: white;
    text-decoration: none;
}

.header-badge {
    background: #FF9900;
    color: #0F1111;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}

.pos-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.pos-content.products-hidden {
    grid-template-columns: 1fr;
    justify-items: center;
}

.pos-content.products-hidden .cart-section {
    max-width: 500px;
    width: 100%;
}

@media (max-width: 1024px) {
    .pos-content {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .pos-content {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .pos-content {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px;
    }
}

.products-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-title {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid #D5D9D9;
    font-size: 21px;
    font-weight: 400;
    color: #0F1111;
    margin: 0;
    flex: 1;
}

.products-header {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid #D5D9D9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.close-products-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
}

.close-products-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #333;
}

.search-container {
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #D5D9D9;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #D5D9D9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.search-input:focus {
    outline: none;
    border-color: #007185;
    box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.1);
}

.products-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr 1fr; /* Exactly 2 products per row on mobile */
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr 1fr; /* Keep 2 products per row even on small phones */
        gap: 8px;
        padding: 8px;
    }
}

.product-card {
    background: white;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

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

@media (max-width: 768px) {
    .product-card {
        padding: 12px;
        border-radius: 6px;
    }
    
    .product-card:hover {
        transform: none; /* Disable hover transform on mobile */
    }
}

@media (max-width: 480px) {
    .product-card {
        padding: 8px;
        border-radius: 4px;
    }
}

.product-image {
    width: 100%;
    height: 140px;
    background: #F7F7F7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .product-image {
        height: 120px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .product-image {
        height: 100px;
        margin-bottom: 6px;
    }
}

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

.product-image i {
    font-size: 40px;
    color: #565959;
}

.product-title {
    font-size: 14px;
    font-weight: 400;
    color: #007185;
    margin-bottom: 4px;
    line-height: 1.3;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
    .product-title {
        font-size: 13px;
        height: 36px;
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 12px;
        height: 32px;
        margin-bottom: 2px;
        -webkit-line-clamp: 2;
    }
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #B12704;
    margin-bottom: 4px;
}

.product-price .currency {
    font-size: 12px;
    vertical-align: top;
}

.product-stock {
    font-size: 12px;
    color: #007600;
    font-weight: 400;
}

.product-stock.low {
    color: #D13212;
}

@media (max-width: 768px) {
    .product-price {
        font-size: 16px;
        margin-bottom: 3px;
    }
    
    .product-price .currency {
        font-size: 11px;
    }
    
    .product-stock {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .product-price {
        font-size: 15px;
        margin-bottom: 2px;
    }
    
    .product-price .currency {
        font-size: 10px;
    }
    
    .product-stock {
        font-size: 10px;
    }
}

.add-btn {
    background: #FF9900;
    color: #0F1111;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: background-color 0.15s ease;
}

.add-btn:hover {
    background: #FA8900;
}

.quantity-controls-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 4px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.qty-btn-product {
    width: 30px;
    height: 30px;
    border: none;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #007185;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.qty-btn-product:hover:not(:disabled) {
    background: #007185;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.qty-btn-product:disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.qty-display-product {
    font-weight: 600;
    font-size: 14px;
    color: #007185;
    min-width: 35px;
    text-align: center;
    padding: 0 5px;
}

@media (max-width: 768px) {
    .qty-btn-product {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .qty-display-product {
        font-size: 13px;
        min-width: 30px;
    }

    .quantity-controls-product {
        padding: 3px;
        border-radius: 16px;
        margin-top: 6px;
    }

    .add-btn {
        padding: 6px 12px;
        font-size: 12px;
        margin-top: 6px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .qty-btn-product {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .qty-display-product {
        font-size: 12px;
        min-width: 28px;
    }

    .quantity-controls-product {
        padding: 2px;
        border-radius: 12px;
        margin-top: 4px;
    }

    .add-btn {
        padding: 5px 10px;
        font-size: 11px;
        margin-top: 4px;
        border-radius: 12px;
    }
}

.cart-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #D5D9D9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-title {
    font-size: 18px;
    font-weight: 700;
    color: #0F1111;
    margin: 0;
}

.cart-count {
    background: #007185;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.customer-section {
    padding: 16px 20px;
    border-bottom: 1px solid #D5D9D9;
}

.customer-label {
    font-size: 14px;
    font-weight: 600;
    color: #0F1111;
    margin-bottom: 8px;
}

.customer-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #D5D9D9;
    border-radius: 4px;
    font-size: 14px;
}

.customer-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #D5D9D9;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.customer-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F0F2F2;
}

.customer-option:hover {
    background: #F0F2F2;
}

.customer-name {
    font-weight: 600;
    color: #0F1111;
    font-size: 14px;
}

.customer-details {
    font-size: 12px;
    color: #565959;
    margin-top: 2px;
}

.selected-customer-info {
    background: #E6F3FF;
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
    border: 1px solid #007185;
}

.outstanding-warning {
    background: #FEF5E7;
    border: 1px solid #F79400;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    color: #B12704;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
}

.empty-cart {
    padding: 40px 20px;
    text-align: center;
    color: #565959;
}

.empty-cart i {
    font-size: 48px;
    color: #D5D9D9;
    margin-bottom: 16px;
    display: block;
}

.cart-item {
    padding: 16px 20px;
    border-bottom: 1px solid #F0F2F2;
    display: flex;
    gap: 12px;
}

.item-image {
    width: 60px;
    height: 60px;
    background: #F7F7F7;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.item-image i {
    font-size: 24px;
    color: #565959;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 14px;
    font-weight: 400;
    color: #007185;
    margin-bottom: 4px;
    line-height: 1.3;
}

.item-price {
    font-size: 14px;
    font-weight: 700;
    color: #B12704;
    margin-bottom: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #D5D9D9;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #007185;
    transition: all 0.15s ease;
}

.qty-btn:hover {
    background: #F0F2F2;
    border-color: #007185;
}

.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid #D5D9D9;
    border-radius: 4px;
    background: white;
}

.remove-item {
    background: none;
    border: none;
    color: #007185;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    margin-top: 4px;
}

.remove-item:hover {
    color: #B12704;
}

.cart-summary {
    padding: 20px;
    background: #F7F7F7;
    border-top: 1px solid #D5D9D9;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: #B12704;
    padding-top: 12px;
    border-top: 1px solid #D5D9D9;
    margin-top: 12px;
}

.checkout-button {
    background: #FF9900;
    color: #0F1111;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    transition: background-color 0.15s ease;
}

.checkout-button:hover {
    background: #FA8900;
}

.checkout-button:disabled {
    background: #D5D9D9;
    color: #565959;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 95%;
    max-width: 500px;
    max-height: 95vh;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 1% auto;
        width: 98%;
        max-height: 98vh;
        border-radius: 6px;
    }
}

.modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #D5D9D9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .modal-header {
        padding: 12px 16px 8px;
    }
}

.modal-title {
    font-size: 18px;
    font-weight: 400;
    color: #0F1111;
    margin: 0;
}

@media (max-width: 768px) {
    .modal-title {
        font-size: 16px;
    }
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #565959;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #F0F2F2;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 12px 16px;
    }
}

.checkout-summary {
    background: #F7F8F8;
    border: 1px solid #D5D9D9;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
}

@media (max-width: 768px) {
    .checkout-summary {
        padding: 10px;
        margin: 10px 0;
        border-radius: 4px;
    }
}

.checkout-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .checkout-summary .summary-row {
        margin-bottom: 4px;
        font-size: 12px;
    }
}

.checkout-summary .summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #B12704;
    padding-top: 6px;
    border-top: 1px solid #D5D9D9;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .checkout-summary .summary-total {
        font-size: 14px;
        padding-top: 4px;
        margin-top: 4px;
    }
}

.form-group {
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 10px;
    }
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #0F1111;
}

.form-control {
    width: 100%;
    padding: 6px 10px;
    border: 2px solid #D5D9D9;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.15s ease-in-out;
}

@media (max-width: 768px) {
    .form-control {
        padding: 5px 8px;
        font-size: 12px;
    }
}

.form-control:focus {
    outline: none;
    border-color: #007185;
    box-shadow: 0 0 0 3px rgba(0, 113, 133, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 12px 20px 16px;
    border-top: 1px solid #D5D9D9;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .modal-actions {
        gap: 8px;
        padding: 10px 16px 12px;
    }
}

.btn-secondary {
    background: white;
    color: #0F1111;
    border: 1px solid #D5D9D9;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
}

@media (max-width: 768px) {
    .btn-secondary {
        padding: 5px 12px;
        font-size: 12px;
        border-radius: 4px;
    }
}

.btn-primary {
    background: #FF9900;
    color: #0F1111;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex: 2;
}

.btn-primary:hover {
    background: #FA8900;
}

@media (max-width: 768px) {
    .btn-primary {
        padding: 5px 12px;
        font-size: 12px;
        border-radius: 4px;
    }
}

/* Button Hover Effects */
.order-btn:hover {
    background: #FA8900 !important;
}

.payment-btn:hover {
    background: #218838 !important;
}

.history-btn:hover {
    background: #138496 !important;
}

.reminder-btn:hover {
    background: #005a6b !important;
}

/* Reminder Styles */
.reminder-item {
    background: #F7F8F8;
    border: 1px solid #D5D9D9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    position: relative;
}

.reminder-item.completed {
    background: #E8F5E8;
    border-color: #4CAF50;
}

.reminder-item.overdue {
    background: #FEF5E7;
    border-color: #F79400;
}

.reminder-date {
    font-size: 12px;
    color: #007185;
    font-weight: 600;
    margin-bottom: 4px;
}

.reminder-text {
    font-size: 13px;
    color: #0F1111;
    margin-bottom: 8px;
    line-height: 1.4;
}

.reminder-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reminder-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
}

.reminder-status.pending {
    background: #FFF2CC;
    color: #B7791F;
}

.reminder-status.completed {
    background: #E8F5E8;
    color: #4CAF50;
}

.reminder-status.overdue {
    background: #FFEBEE;
    color: #F44336;
}

.mark-complete-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 600;
}

.mark-complete-btn:hover {
    background: #45a049;
}

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

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

::-webkit-scrollbar-thumb {
    background: #C4C4C4;
    border-radius: 3px;
}

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