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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.header h1 {
    font-size: 24px;
    margin: 0;
}

.kiosk-toggle-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.kiosk-toggle-btn:hover {
    background: rgba(255,255,255,0.25);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
}

.left-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.search-section {
    margin-bottom: 20px;
}

.search-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.search-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #999;
    border-radius: 6px;
    font-size: 16px;
    color: #333;
    transition: border-color 0.3s;
}

.search-input::placeholder {
    color: #666;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-results {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.product-item:hover {
    background: #f8f9fa;
}

.product-item:last-child {
    border-bottom: none;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    border: 1px solid #ddd;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.product-model {
    font-size: 13px;
    color: #7f8c8d;
}

.product-price {
    font-weight: 600;
    color: #27ae60;
    font-size: 16px;
}

.product-stock {
    font-size: 12px;
    color: #95a5a6;
    margin-left: 8px;
}

.cart-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.cart-items {
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.cart-item-info {
    flex: 1;
    margin-right: 10px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-sku {
    font-size: 12px;
    color: #555;
    font-weight: 700;
}

.cart-item-price {
    font-size: 13px;
    color: #2c3e50;
    font-weight: 700;
}

.price-edit-input {
    width: 70px;
    padding: 2px 4px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 13px;
    text-align: right;
    color: #2c3e50;
    font-weight: 700;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    background: #3498db;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #2980b9;
}

.qty-input {
    width: 50px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.remove-btn:hover {
    background: #c0392b;
}

.customer-section {
    margin-bottom: 15px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 6px;
}

.customer-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.customer-section select,
.customer-section input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.tax-exempt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.tax-exempt-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.tax-exempt-row label {
    display: inline !important;
    margin-bottom: 0 !important;
    font-weight: 600;
    color: #555;
    font-size: 14px;
    cursor: pointer;
}

.tax-exempt-reason {
    font-size: 12px;
    color: #e67e22;
    font-style: italic;
}

.shipping-section {
    margin-bottom: 15px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 6px;
}

.shipping-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.shipping-section input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cart-totals {
    border-top: 2px solid #ddd;
    padding-top: 15px;
    margin-bottom: 15px;
}

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

.total-row.grand-total {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    padding-top: 10px;
    border-top: 2px solid #3498db;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background: #3498db;
    color: white;
}

.btn-secondary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.order-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal:hover {
    color: #e74c3c;
}

.order-list {
    margin-top: 15px;
}

.order-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.order-item:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.order-id {
    font-weight: 700;
    color: #2c3e50;
}

.order-date {
    color: #7f8c8d;
    font-size: 13px;
}

.order-customer {
    font-size: 14px;
    margin-bottom: 5px;
}

.order-total {
    font-weight: 600;
    color: #27ae60;
    font-size: 16px;
}

.empty-cart {
    text-align: center;
    padding: 30px;
    color: #95a5a6;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab:hover {
    color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.customer-search-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.customer-search-wrapper input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.customer-search-results.active {
    display: block;
}

.customer-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.customer-result-item:hover {
    background: #f0f7ff;
}

.customer-result-item:last-child {
    border-bottom: none;
}

.customer-result-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.customer-result-detail {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 2px;
}

.selected-customer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #155724;
    font-weight: 600;
}

.clear-customer-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #155724;
    line-height: 1;
    padding: 0 4px;
}

.clear-customer-btn:hover {
    color: #e74c3c;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .right-panel {
        position: static;
    }
}

/* Kiosk Mode Overrides */
.kiosk-mode {
    font-size: 18px;
}

.kiosk-mode .header h1 {
    font-size: 30px;
}

.kiosk-mode .cart-section h3,
.kiosk-mode .search-section h3 {
    font-size: 22px;
}

.kiosk-mode .search-input {
    padding: 16px;
    font-size: 18px;
}

.kiosk-mode .btn {
    padding: 18px;
    font-size: 20px;
}

.kiosk-mode .tab {
    padding: 16px 30px;
    font-size: 20px;
}

.kiosk-mode .product-item {
    padding: 16px;
}

.kiosk-mode .product-name {
    font-size: 17px;
}

.kiosk-mode .product-model {
    font-size: 15px;
}

.kiosk-mode .product-price {
    font-size: 20px;
}

.kiosk-mode .product-stock {
    font-size: 14px;
}

.kiosk-mode .product-image {
    width: 80px;
    height: 80px;
}

.kiosk-mode .cart-item {
    padding: 14px;
}

.kiosk-mode .cart-item-image {
    width: 65px;
    height: 65px;
}

.kiosk-mode .cart-item-name {
    font-size: 18px;
}

.kiosk-mode .cart-item-sku {
    font-size: 14px;
}

.kiosk-mode .cart-item-price {
    font-size: 16px;
}

.kiosk-mode .price-edit-input {
    width: 80px;
    padding: 4px 6px;
    font-size: 16px;
}

.kiosk-mode .qty-btn {
    width: 35px;
    height: 35px;
    font-size: 20px;
}

.kiosk-mode .qty-input {
    width: 60px;
    padding: 8px;
    font-size: 18px;
}

.kiosk-mode .remove-btn {
    padding: 8px 14px;
    font-size: 14px;
}

.kiosk-mode .total-row {
    font-size: 18px;
}

.kiosk-mode .total-row.grand-total {
    font-size: 24px;
}

.kiosk-mode .customer-section label,
.kiosk-mode .shipping-section label,
.kiosk-mode .search-section label {
    font-size: 17px;
}

.kiosk-mode .customer-section select,
.kiosk-mode .customer-section input,
.kiosk-mode .shipping-section input {
    padding: 12px;
    font-size: 18px;
}

.kiosk-mode .tax-exempt-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

.kiosk-mode .tax-exempt-row label {
    font-size: 18px !important;
}

.kiosk-mode .tax-exempt-reason {
    font-size: 15px;
}

.kiosk-mode .customer-search-wrapper input {
    padding: 12px;
    font-size: 18px;
}

.kiosk-mode .customer-result-name {
    font-size: 17px;
}

.kiosk-mode .customer-result-detail {
    font-size: 14px;
}

.kiosk-mode .selected-customer-info {
    font-size: 17px;
    padding: 10px 14px;
}

.kiosk-mode .order-item {
    padding: 18px;
}

.kiosk-mode .order-id {
    font-size: 18px;
}

.kiosk-mode .order-date {
    font-size: 15px;
}

.kiosk-mode .order-customer {
    font-size: 17px;
}

.kiosk-mode .order-total {
    font-size: 20px;
}

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

.kiosk-mode .alert {
    font-size: 17px;
    padding: 14px 18px;
}

.kiosk-mode .kiosk-toggle-btn {
    font-size: 16px;
    padding: 10px 22px;
}

/* Order Processing Overlay */
.order-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.order-overlay.active {
    display: flex;
}

.order-overlay-content {
    background: white;
    border-radius: 12px;
    padding: 50px 60px;
    text-align: center;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.order-overlay-spinner-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.order-overlay-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    animation: overlay-spin 0.8s linear infinite;
}

@keyframes overlay-spin {
    to { transform: rotate(360deg); }
}

.order-overlay-message {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
}

.order-overlay-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.order-overlay-icon {
    font-size: 64px;
    line-height: 1;
}

.order-overlay-icon.success {
    color: #27ae60;
}

.order-overlay-icon.error {
    color: #e74c3c;
}

.order-overlay-result-msg {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
}

.order-overlay-ok-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 16px 60px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

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

.order-overlay-ok-btn.error {
    background: #e74c3c;
}

.order-overlay-ok-btn.error:hover {
    background: #c0392b;
}

.order-overlay-no-btn {
    background: #95a5a6;
}

.order-overlay-no-btn:hover {
    background: #7f8c8d;
}

.order-overlay-print-prompt {
    margin-top: 10px;
}

.order-overlay-print-label {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.order-overlay-print-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.order-overlay-print-buttons .order-overlay-ok-btn {
    padding: 14px 50px;
    font-size: 18px;
}

/* Kiosk mode overlay overrides */
.kiosk-mode .order-overlay-content {
    padding: 60px 80px;
    min-width: 500px;
    max-width: 600px;
}

.kiosk-mode .order-overlay-spinner {
    width: 80px;
    height: 80px;
    border-width: 8px;
}

.kiosk-mode .order-overlay-message {
    font-size: 28px;
}

.kiosk-mode .order-overlay-icon {
    font-size: 80px;
}

.kiosk-mode .order-overlay-result-msg {
    font-size: 28px;
}

.kiosk-mode .order-overlay-ok-btn {
    padding: 20px 80px;
    font-size: 26px;
}

.kiosk-mode .order-overlay-print-label {
    font-size: 26px;
}

.kiosk-mode .order-overlay-print-buttons .order-overlay-ok-btn {
    padding: 18px 60px;
    font-size: 24px;
}

/* Print Receipt Area - hidden on screen */
.print-receipt-area {
    display: none;
}

@media print {
    /* Hide everything on screen */
    body > *:not(.print-receipt-area) {
        display: none !important;
    }

    .print-receipt-area {
        display: block !important;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 10px;
        font-family: 'Courier New', Courier, monospace;
        font-size: 12px;
        color: #000;
    }

    .receipt-header {
        text-align: center;
        border-bottom: 2px dashed #000;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .receipt-header h2 {
        font-size: 18px;
        margin: 0 0 4px 0;
    }

    .receipt-header p {
        margin: 2px 0;
        font-size: 11px;
    }

    .receipt-info {
        border-bottom: 1px dashed #000;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .receipt-info p {
        margin: 2px 0;
        font-size: 12px;
    }

    .receipt-items {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 10px;
    }

    .receipt-items th {
        text-align: left;
        border-bottom: 1px solid #000;
        padding: 4px 2px;
        font-size: 11px;
    }

    .receipt-items th:nth-child(2),
    .receipt-items td:nth-child(2) {
        text-align: center;
    }

    .receipt-items th:nth-child(3),
    .receipt-items td:nth-child(3),
    .receipt-items th:nth-child(4),
    .receipt-items td:nth-child(4) {
        text-align: right;
    }

    .receipt-items td {
        padding: 3px 2px;
        font-size: 12px;
        border-bottom: 1px dotted #ccc;
    }

    .receipt-totals {
        border-top: 2px dashed #000;
        padding-top: 8px;
        margin-top: 4px;
    }

    .receipt-total-row {
        display: flex;
        justify-content: space-between;
        padding: 2px 0;
        font-size: 12px;
    }

    .receipt-total-row.grand-total {
        font-size: 16px;
        font-weight: 700;
        border-top: 1px solid #000;
        padding-top: 6px;
        margin-top: 4px;
    }

    .receipt-footer {
        text-align: center;
        border-top: 2px dashed #000;
        padding-top: 10px;
        margin-top: 12px;
        font-size: 12px;
    }

    .receipt-footer p {
        margin: 2px 0;
    }
}
