* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #f5f5f5;
    padding-bottom: 80px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.header-title p {
    font-size: 14px;
    opacity: 0.9;
}

.search-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e5e5e5;
}

#searchInput {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background-color: #f5f5f5;
}

#searchInput:focus {
    background-color: #fff;
    border-color: #ff6b35;
}

.search-btn {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
}

.search-btn:hover {
    background-color: #f5f5f5;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background-color: #f5f5f5;
    min-width: 150px;
    cursor: pointer;
}

.filter-select:focus {
    background-color: #fff;
    border-color: #ff6b35;
}

.product-name-es,
.car-model-es {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

.header-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.logout-btn {
    padding: 8px 16px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #ff5520;
}

.main-content {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.category-sidebar {
    width: 90px;
    background-color: #f8f8f8;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    flex-shrink: 0;
}

.category-item {
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 13px;
    color: #333;
}

.category-item:hover {
    background-color: #fff;
    color: #ff6b35;
}

.category-item.active {
    background-color: #fff;
    color: #ff6b35;
    border-left-color: #ff6b35;
    font-weight: 500;
}

.product-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.table-container {
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.product-table th,
.product-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}

.product-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-table tbody tr:hover {
    background-color: #f8f9fa;
}

.product-table tbody tr.selected {
    background-color: #e8f4fd;
}

.col-select {
    width: 50px;
    text-align: center;
}

.col-image {
    width: 80px;
}

.col-name {
    min-width: 200px;
}

.col-car {
    min-width: 150px;
}

.col-oem {
    min-width: 120px;
}

.col-desc {
    min-width: 250px;
    max-width: 350px;
}

.col-price {
    width: 100px;
}

.col-qty {
    width: 140px;
}

.product-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.table-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f5f5f5;
    cursor: zoom-in;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.image-modal img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: default;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.3s;
    z-index: 10;
}

.modal-nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: none;
}


.table-product-name {
    font-weight: 500;
    color: #333;
}

.table-price {
    font-size: 16px;
    font-weight: 600;
    color: #ff6b35;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #667eea;
    background-color: #fff;
    color: #667eea;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background-color: #667eea;
    color: #fff;
}

.quantity-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
}

.quantity-input:focus {
    outline: none;
    border-color: #667eea;
}

.order-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1400px;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.order-info {
    display: flex;
    gap: 24px;
    align-items: center;
}

.selected-count {
    font-size: 14px;
    color: #666;
}

.order-total {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b35;
}

.order-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.order-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
    }
    
    .header-title h1 {
        font-size: 16px;
    }
    
    .header-title p {
        font-size: 12px;
    }
    
    .category-sidebar {
        width: 70px;
    }
    
    .category-item {
        padding: 12px 4px;
        font-size: 12px;
    }
    
    .product-table {
        font-size: 12px;
    }
    
    .table-product-image {
        width: 40px;
        height: 40px;
    }
    
    .order-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .order-info {
        flex-direction: column;
        gap: 8px;
    }
}
